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

Method CloseSessionHandler

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

Source from the content-addressed store, hash-verified

285}
286
287void 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
313void ImpalaHttpHandler::QueryProfileHandler(const Webserver::WebRequest& req,
314 Document* document) {

Callers

nothing calls this directly

Calls 8

ParseIdFromRequestFunction · 0.85
SubstituteFunction · 0.85
PrintIdFunction · 0.85
GetDetailMethod · 0.80
CloseSessionInternalMethod · 0.80
okMethod · 0.45
AddMemberMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected