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

Method TryToIncreaseMemAllocationForMerge

be/src/runtime/sorter.cc:1472–1484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1470}
1471
1472void Sorter::TryToIncreaseMemAllocationForMerge() {
1473 int pages_needed_for_full_merge = 0;
1474 for (auto run : sorted_runs_) {
1475 pages_needed_for_full_merge += (run->HasVarLenPages()) ? 2 : 1;
1476 }
1477 int available_pages = buffer_pool_client_->GetUnusedReservation() / page_len_;
1478
1479 // Start allocating more pages than available now. Stop once no more memory can be
1480 // allocated.
1481 for (int i = 0; i < pages_needed_for_full_merge - available_pages; ++i) {
1482 if (!buffer_pool_client_->IncreaseReservation(page_len_)) return;
1483 }
1484}
1485
1486int Sorter::GetNumOfRunsForMerge() const {
1487 int max_runs_in_next_merge = MaxRunsInNextMerge();

Callers

nothing calls this directly

Calls 3

HasVarLenPagesMethod · 0.80
GetUnusedReservationMethod · 0.45
IncreaseReservationMethod · 0.45

Tested by

no test coverage detected