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

Function TEST_F

be/src/runtime/bufferpool/reservation-tracker-test.cc:76–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74const int64_t ReservationTrackerTest::MIN_BUFFER_LEN;
75
76TEST_F(ReservationTrackerTest, BasicSingleTracker) {
77 const int64_t limit = 16;
78 root_.InitRootTracker(NULL, limit);
79 ASSERT_EQ(0, root_.GetReservation());
80 ASSERT_EQ(0, root_.GetUsedReservation());
81
82 // Fail to increase reservation.
83 ASSERT_FALSE(root_.IncreaseReservation(limit + 1));
84 ASSERT_EQ(0, root_.GetReservation());
85 ASSERT_EQ(0, root_.GetUsedReservation());
86 ASSERT_EQ(0, root_.GetUnusedReservation());
87
88 // Successfully increase reservation.
89 ASSERT_TRUE(root_.IncreaseReservation(limit - 1));
90 ASSERT_EQ(limit - 1, root_.GetReservation());
91 ASSERT_EQ(0, root_.GetUsedReservation());
92 ASSERT_EQ(limit - 1, root_.GetUnusedReservation());
93
94 // Adjust usage.
95 root_.AllocateFrom(2);
96 ASSERT_EQ(limit - 1, root_.GetReservation());
97 ASSERT_EQ(2, root_.GetUsedReservation());
98 ASSERT_EQ(limit - 3, root_.GetUnusedReservation());
99 root_.ReleaseTo(1);
100 ASSERT_EQ(1, root_.GetUsedReservation());
101 root_.ReleaseTo(1);
102 ASSERT_EQ(0, root_.GetUsedReservation());
103 ASSERT_EQ(limit - 1, root_.GetReservation());
104 ASSERT_EQ(limit - 1, root_.GetUnusedReservation());
105}
106
107TEST_F(ReservationTrackerTest, BasicTwoLevel) {
108 const int64_t limit = 16;

Callers

nothing calls this directly

Calls 15

maxFunction · 0.85
SubstituteFunction · 0.85
InitRootTrackerMethod · 0.80
AllocateFromMethod · 0.80
ReleaseToMethod · 0.80
GetChildReservationsMethod · 0.80
InitChildTrackerMethod · 0.80
GetLowestLimitMethod · 0.80
LogUsageMethod · 0.80
resetMethod · 0.65
getMethod · 0.65
GetReservationMethod · 0.45

Tested by

no test coverage detected