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

Method CheckConsistency

be/src/runtime/bufferpool/reservation-tracker.cc:430–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430void ReservationTracker::CheckConsistency() const {
431 // Check internal invariants.
432 DCHECK_GE(reservation_.Load(), 0);
433 DCHECK_LE(reservation_.Load(), reservation_limit_.Load());
434 DCHECK_GE(child_reservations_.Load(), 0);
435 DCHECK_GE(used_reservation_.Load(), 0);
436 DCHECK_LE(used_reservation_.Load() + child_reservations_.Load(), reservation_.Load())
437 << used_reservation_.Load() << " + " << child_reservations_.Load() << " > "
438 << reservation_.Load();
439
440 DCHECK_EQ(reservation_.Load(), counters_.peak_reservation->current_value());
441 DCHECK_LE(reservation_.Load(), counters_.peak_reservation->value());
442 DCHECK_EQ(used_reservation_.Load(), counters_.peak_used_reservation->current_value());
443 DCHECK_LE(used_reservation_.Load(), counters_.peak_used_reservation->value());
444 if (counters_.reservation_limit != nullptr) {
445 DCHECK_EQ(reservation_limit_.Load(), counters_.reservation_limit->value());
446 }
447}
448
449void ReservationTracker::UpdateUsedReservation(int64_t delta) {
450 int64_t used_reservation = used_reservation_.Add(delta);

Callers 1

TransferReservationToMethod · 0.45

Calls 3

LoadMethod · 0.45
current_valueMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected