| 285 | } |
| 286 | |
| 287 | void ImpalaHttpHandler::CloseSessionHandler(const Webserver::WebRequest& req, |
| 288 | Document* document) { |
| 289 | TUniqueId unique_id; |
| 290 | Status status = ParseIdFromRequest(req, &unique_id, "session_id"); |
| 291 | if (!status.ok()) { |
| 292 | Value error(status.GetDetail(), document->GetAllocator()); |
| 293 | document->AddMember("error", error, document->GetAllocator()); |
| 294 | return; |
| 295 | } |
| 296 | Status cause(Substitute("Session closed from Impala's debug web interface by user:" |
| 297 | " '$0' at $1", req.source_user, req.source_socket)); |
| 298 | // Web UI doesn't have access to secret so we can't validate it. We assume that |
| 299 | // web UI is allowed to close sessions. |
| 300 | status = server_->CloseSessionInternal(unique_id, |
| 301 | ImpalaServer::SecretArg::SkipSecretCheck(), /* ignore_if_absent= */ false); |
| 302 | if (!status.ok()) { |
| 303 | Value error(status.GetDetail(), document->GetAllocator()); |
| 304 | document->AddMember("error", error, document->GetAllocator()); |
| 305 | return; |
| 306 | } |
| 307 | stringstream ss; |
| 308 | ss << "Session " << PrintId(unique_id) << " closed successfully"; |
| 309 | Value message(ss.str(), document->GetAllocator()); |
| 310 | document->AddMember("contents", message, document->GetAllocator()); |
| 311 | } |
| 312 | |
| 313 | void ImpalaHttpHandler::QueryProfileHandler(const Webserver::WebRequest& req, |
| 314 | Document* document) { |
nothing calls this directly
no test coverage detected