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

Method CancelQueryHandler

be/src/service/impala-http-handler.cc:264–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264void ImpalaHttpHandler::CancelQueryHandler(const Webserver::WebRequest& req,
265 Document* document) {
266 TUniqueId unique_id;
267 Status status = ParseIdFromRequest(req, &unique_id, "query_id");
268 if (!status.ok()) {
269 Value error(status.GetDetail(), document->GetAllocator());
270 document->AddMember("error", error, document->GetAllocator());
271 return;
272 }
273 Status cause(Substitute("Cancelled from Impala's debug web interface by user:"
274 " '$0' at $1", req.source_user, req.source_socket));
275 // Web UI doesn't have access to secret so we can't validate it. We assume that
276 // web UI is allowed to close queries.
277 status = server_->UnregisterQuery(unique_id, &cause, /* interrupted */ true);
278 if (!status.ok()) {
279 Value error(status.GetDetail(), document->GetAllocator());
280 document->AddMember("error", error, document->GetAllocator());
281 return;
282 }
283 Value message("Query cancellation successful", document->GetAllocator());
284 document->AddMember("contents", message, document->GetAllocator());
285}
286
287void ImpalaHttpHandler::CloseSessionHandler(const Webserver::WebRequest& req,
288 Document* document) {

Callers

nothing calls this directly

Calls 6

ParseIdFromRequestFunction · 0.85
SubstituteFunction · 0.85
GetDetailMethod · 0.80
UnregisterQueryMethod · 0.80
okMethod · 0.45
AddMemberMethod · 0.45

Tested by

no test coverage detected