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

Method TryLowerMemUpToSortRunBytesLimit

be/src/runtime/sorter.cc:1268–1282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1266}
1267
1268void Sorter::TryLowerMemUpToSortRunBytesLimit() {
1269 DCHECK(enforce_sort_run_bytes_limit_);
1270 int unused_reservation = buffer_pool_client_->GetUnusedReservation();
1271 int current_reservation = buffer_pool_client_->GetReservation();
1272 int threshold = GetSortRunBytesLimit() + page_len_; // tolerate +1 page
1273
1274 if (current_reservation > threshold) {
1275 Status status = buffer_pool_client_->DecreaseReservationTo(
1276 unused_reservation, GetSortRunBytesLimit());
1277 DCHECK(status.ok());
1278 VLOG(3) << Substitute("Sorter reservation decreased from $0 to $1",
1279 PrettyPrinter::PrintBytes(current_reservation),
1280 PrettyPrinter::PrintBytes(buffer_pool_client_->GetReservation()));
1281 }
1282}
1283
1284Status Sorter::AddBatchNoSpill(RowBatch* batch, int start_index, int* num_processed) {
1285 DCHECK(batch != nullptr);

Callers

nothing calls this directly

Calls 6

SubstituteFunction · 0.85
PrintBytesFunction · 0.85
DecreaseReservationToMethod · 0.80
GetUnusedReservationMethod · 0.45
GetReservationMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected