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

Method UpdateStatsOnReleaseForBackends

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

Source from the content-addressed store, hash-verified

1031}
1032
1033void AdmissionController::UpdateStatsOnReleaseForBackends(const UniqueIdPB& query_id,
1034 RunningQuery& running_query, const vector<NetworkAddressPB>& host_addrs) {
1035 int64_t total_mem_to_release = 0;
1036 for (const auto& host_addr : host_addrs) {
1037 auto backend_allocation = running_query.per_backend_resources.find(host_addr);
1038 if (backend_allocation == running_query.per_backend_resources.end()) {
1039 // In the context of the admission control service, this may happen, e.g. if a
1040 // ReleaseQueryBackends rpc is delayed in the network and arrives after the
1041 // ReleaseQuery rpc, so only log as a WARNING.
1042 string err_msg =
1043 strings::Substitute("Error: Cannot find exec params of host $0 for query $1.",
1044 NetworkAddressPBToString(host_addr), PrintId(query_id));
1045 LOG(WARNING) << err_msg;
1046 continue;
1047 }
1048 UpdateHostStats(host_addr, -backend_allocation->second.mem_to_admit, -1,
1049 -backend_allocation->second.slots_to_use);
1050 total_mem_to_release += backend_allocation->second.mem_to_admit;
1051 running_query.per_backend_resources.erase(backend_allocation);
1052 }
1053 PoolStats* pool_stats = GetPoolStats(running_query.request_pool);
1054 pool_stats->ReleaseMem(total_mem_to_release);
1055 pools_for_updates_.insert(running_query.request_pool);
1056}
1057
1058void AdmissionController::UpdateStatsOnAdmission(
1059 const ScheduleState& state, bool is_trivial, PerUserTracking& per_user_tracking) {

Callers

nothing calls this directly

Calls 8

SubstituteFunction · 0.85
NetworkAddressPBToStringFunction · 0.85
PrintIdFunction · 0.85
eraseMethod · 0.80
ReleaseMemMethod · 0.80
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected