| 1266 | } |
| 1267 | |
| 1268 | void 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 | |
| 1284 | Status Sorter::AddBatchNoSpill(RowBatch* batch, int start_index, int* num_processed) { |
| 1285 | DCHECK(batch != nullptr); |
nothing calls this directly
no test coverage detected