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

Method UpdateMemTrackerStats

be/src/scheduling/admission-controller.cc:2598–2622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2596}
2597
2598void AdmissionController::PoolStats::UpdateMemTrackerStats() {
2599 // May be NULL if no queries have ever executed in this pool on this node but another
2600 // node sent stats for this pool.
2601 MemTracker* tracker =
2602 parent_->pool_mem_trackers_->GetRequestPoolMemTracker(name_, false);
2603
2604 if (tracker) {
2605 // Update local_stats_ with the query Ids of the top 5 queries, plus the min, the max,
2606 // the total memory consumption, and the number of all queries running on this
2607 // host tracked by this pool.
2608 tracker->UpdatePoolStatsForQueries(5 /*limit*/, this->local_stats_);
2609 }
2610
2611 const int64_t current_reserved =
2612 tracker == nullptr ? static_cast<int64_t>(0) : tracker->GetPoolMemReserved();
2613 if (current_reserved != local_stats_.backend_mem_reserved) {
2614 parent_->pools_for_updates_.insert(name_);
2615 local_stats_.backend_mem_reserved = current_reserved;
2616 metrics_.local_backend_mem_reserved->SetValue(current_reserved);
2617 }
2618
2619 const int64_t current_usage =
2620 tracker == nullptr ? static_cast<int64_t>(0) : tracker->consumption();
2621 metrics_.local_backend_mem_usage->SetValue(current_usage);
2622}
2623
2624void AdmissionController::AddPoolAndPerHostStatsUpdates(
2625 vector<TTopicDelta>* topic_updates) {

Callers 2

TEST_FFunction · 0.80

Calls 6

GetPoolMemReservedMethod · 0.80
insertMethod · 0.45
SetValueMethod · 0.45
consumptionMethod · 0.45

Tested by 1

TEST_FFunction · 0.64