| 262 | } |
| 263 | |
| 264 | void 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 | |
| 287 | void ImpalaHttpHandler::CloseSessionHandler(const Webserver::WebRequest& req, |
| 288 | Document* document) { |
nothing calls this directly
no test coverage detected