Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Support kill multi query.
Browse files Browse the repository at this point in the history
  • Loading branch information
CPWstatic committed Jun 29, 2021
1 parent 1e07408 commit 079ba15
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/common/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3718,11 +3718,10 @@ folly::Future<StatusOr<cpp2::ExecResp>> MetaClient::removeSession(SessionID sess
return future;
}

folly::Future<StatusOr<cpp2::ExecResp>> MetaClient::killQuery(SessionID sessionId,
ExecutionPlanID epId) {
folly::Future<StatusOr<cpp2::ExecResp>> MetaClient::killQuery(
std::unordered_map<SessionID, std::unordered_set<ExecutionPlanID>> killQueries) {
cpp2::KillQueryReq req;
req.set_session_id(sessionId);
req.set_ep_id(epId);
req.set_kill_queries(std::move(killQueries));
folly::Promise<StatusOr<cpp2::ExecResp>> promise;
auto future = promise.getFuture();
getResponse(std::move(req),
Expand Down
3 changes: 2 additions & 1 deletion src/common/clients/meta/MetaClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ class MetaClient {

folly::Future<StatusOr<cpp2::ExecResp>> removeSession(SessionID sessionId);

folly::Future<StatusOr<cpp2::ExecResp>> killQuery(SessionID sessionId, ExecutionPlanID epId);
folly::Future<StatusOr<cpp2::ExecResp>> killQuery(
std::unordered_map<SessionID, std::unordered_set<ExecutionPlanID>> killQueries);

// Opeartions for cache.
StatusOr<GraphSpaceID> getSpaceIdByNameFromCache(const std::string& name);
Expand Down
4 changes: 2 additions & 2 deletions src/common/interface/common.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ enum ErrorCode {
E_RESTORE_FAILURE = -2068,

E_SESSION_NOT_FOUND = -2069,
E_QUERY_NOT_FOUND = -2070,

// ListClusterInfo Failure
E_LIST_CLUSTER_FAILURE = -2070,
E_LIST_CLUSTER_GET_ABS_PATH_FAILURE = -2071,
E_GET_META_DIR_FAILURE = -2072,
E_GET_META_DIR_FAILURE = -2072,

E_QUERY_NOT_FOUND = -2073,

// 3xxx for storaged
E_CONSENSUS_ERROR = -3001,
Expand Down
4 changes: 2 additions & 2 deletions src/common/interface/meta.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -1138,8 +1138,8 @@ struct RemoveSessionReq {
}

struct KillQueryReq {
1: common.SessionID session_id,
2: common.ExecutionPlanID ep_id,
1: map<common.SessionID, set<common.ExecutionPlanID> (cpp.template = "std::unordered_set")>
(cpp.template = "std::unordered_map") kill_queries,
}

struct ReportTaskReq {
Expand Down

0 comments on commit 079ba15

Please sign in to comment.