MCPcopy Create free account
hub / github.com/apache/impala / KillQuery

Method KillQuery

be/src/service/impala-server.cc:2019–2042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2017}
2018
2019Status ImpalaServer::KillQuery(
2020 const TUniqueId& query_id, const string& requesting_user, bool is_admin) {
2021 VLOG_QUERY << "KillQuery(): query_id=" << PrintId(query_id)
2022 << ", requesting_user=" << requesting_user << ", is_admin=" << is_admin;
2023 QueryHandle query_handle;
2024 RETURN_IF_ERROR(GetActiveQueryHandle(query_id, &query_handle));
2025 if (!is_admin && requesting_user != query_handle->effective_user()) {
2026 return Status(
2027 Substitute("User '$0' is not authorized to kill the query.", requesting_user));
2028 }
2029 Status status = CancelInternal(query_id);
2030 if (status.code() != TErrorCode::INVALID_QUERY_HANDLE) {
2031 // The current impalad is the coordinator of the query.
2032 RETURN_IF_ERROR(status);
2033 status = UnregisterQuery(query_id, &Status::CANCELLED, true);
2034 if (status.ok() || status.code() == TErrorCode::INVALID_QUERY_HANDLE) {
2035 // There might be another thread that has already unregistered the query
2036 // before UnregisterQuery() and after CancelInternal(). In this case we are done.
2037 return Status::OK();
2038 }
2039 return status;
2040 }
2041 return status;
2042}
2043
2044Status ImpalaServer::CloseSessionInternal(const TUniqueId& session_id,
2045 const SecretArg& secret, bool ignore_if_absent) {

Callers 1

TryKillQueryLocallyMethod · 0.45

Calls 7

PrintIdFunction · 0.85
SubstituteFunction · 0.85
OKFunction · 0.85
effective_userMethod · 0.80
codeMethod · 0.80
StatusClass · 0.50
okMethod · 0.45

Tested by

no test coverage detected