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

Method ReleaseQuery

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

Source from the content-addressed store, hash-verified

879}
880
881void AdmissionController::PoolStats::ReleaseQuery(
882 int64_t peak_mem_consumption, bool is_trivial, const std::string& user) {
883 // Update stats tracking the number of running and admitted queries.
884 agg_num_running_ -= 1;
885 metrics_.agg_num_running->Increment(-1L);
886
887 local_stats_.num_admitted_running -= 1;
888 metrics_.local_num_admitted_running->Increment(-1L);
889
890 metrics_.total_released->Increment(1L);
891 DCHECK_GE(local_stats_.num_admitted_running, 0);
892 DCHECK_GE(agg_num_running_, 0);
893 if (is_trivial) {
894 --local_trivial_running_;
895 DCHECK_GE(local_trivial_running_, 0);
896 }
897
898 if (!user.empty()) {
899 // Non-empty user name means user quotas are being used.
900 DecrementPerUser(user);
901 }
902
903 // Update the 'peak_mem_histogram' based on the given peak memory consumption of the
904 // query, if provided.
905 if (peak_mem_consumption != -1) {
906 int64_t histogram_bucket =
907 BitUtil::RoundUp(peak_mem_consumption, HISTOGRAM_BIN_SIZE) / HISTOGRAM_BIN_SIZE;
908 histogram_bucket =
909 std::max(std::min(histogram_bucket, HISTOGRAM_NUM_OF_BINS), 1L) - 1;
910 peak_mem_histogram_[histogram_bucket] = ++(peak_mem_histogram_[histogram_bucket]);
911 }
912}
913
914void AdmissionController::PoolStats::ReleaseMem(int64_t mem_to_release) {
915 // Update stats tracking memory admitted.

Callers 2

TEST_FFunction · 0.45

Calls 13

maxFunction · 0.85
minFunction · 0.85
PrintIdFunction · 0.85
push_backMethod · 0.80
eraseMethod · 0.80
NotifyOneMethod · 0.80
IncrementMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45

Tested by 1

TEST_FFunction · 0.36