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

Method QueryMemoryHandler

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

Source from the content-addressed store, hash-verified

427}
428
429void ImpalaHttpHandler::QueryMemoryHandler(const Webserver::WebRequest& req,
430 Document* document) {
431 TUniqueId unique_id;
432 Status parse_status = ParseIdFromRequest(req, &unique_id, "query_id");
433 if (!parse_status.ok()) {
434 Value error(parse_status.GetDetail(), document->GetAllocator());
435 document->AddMember("error", error, document->GetAllocator());
436 return;
437 }
438 QueryState::ScopedRef qs(unique_id);
439 string mem_usage_text;
440 // Only queries that have started execution have a MemTracker to get usage from.
441 if (qs.get() != nullptr) {
442 mem_usage_text = qs->query_mem_tracker()->LogUsage(MemTracker::UNLIMITED_DEPTH);
443 } else {
444 mem_usage_text = "The query has either finished or has not started execution yet, "
445 "current memory consumption is not available.";
446 }
447
448 Value mem_usage(mem_usage_text, document->GetAllocator());
449 document->AddMember("mem_usage", mem_usage, document->GetAllocator());
450 const auto& args = req.parsed_args;
451 Value query_id(args.find("query_id")->second, document->GetAllocator());
452 document->AddMember("query_id", query_id, document->GetAllocator());
453}
454
455void ImpalaHttpHandler::QueryAiGenerateAnalysisHandler(const Webserver::WebRequest& req,
456 Document* document) {

Callers

nothing calls this directly

Calls 8

ParseIdFromRequestFunction · 0.85
GetDetailMethod · 0.80
LogUsageMethod · 0.80
getMethod · 0.65
okMethod · 0.45
AddMemberMethod · 0.45
query_mem_trackerMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected