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

Function TEST_F

be/src/util/cache/lirs-cache-test.cc:98–112  ·  view source on GitHub ↗

This tests a very simple case: insert entries, then flush the cache and verify entries are evicted in the appropriate order.

Source from the content-addressed store, hash-verified

96// This tests a very simple case: insert entries, then flush the cache and verify
97// entries are evicted in the appropriate order.
98TEST_F(LIRSCacheTest, BasicEvictionOrdering) {
99 FillCache();
100 FlushCache();
101
102 // There were 5 unprotected elements (95-99). They should be the first to be evicted.
103 for (int i = 0; i < 5; ++i) {
104 ASSERT_EQ(evicted_keys_[i], 95+i);
105 ASSERT_EQ(evicted_values_[i], 95+i);
106 }
107 // There were 95 protected elements (0-94). They should be evicted in order.
108 for (int i = 5; i < 100; ++i) {
109 ASSERT_EQ(evicted_keys_[i], i-5);
110 ASSERT_EQ(evicted_values_[i], i-5);
111 }
112}
113
114// Lookup operations can be tagged as NO_UPDATE, in which case, nothing should change
115// priority. Verify that adding NO_UPDATE Lookups to the basic case does not change

Callers

nothing calls this directly

Calls 8

InsertClass · 0.85
MaxChargeMethod · 0.80
ChargeMethod · 0.80
EncodeIntFunction · 0.70
clearMethod · 0.65
sizeMethod · 0.45
LookupMethod · 0.45
UpdateChargeMethod · 0.45

Tested by

no test coverage detected