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

Method TrimRecencyList

be/src/util/cache/lirs-cache.cc:560–575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560void LIRSCacheShard::TrimRecencyList(LIRSThreadState* tstate) {
561 // This function maintains the invariant that the oldest entry in the list must be
562 // a protected entry. Look at the oldest entry in the list (i.e. the front). If it is
563 // not protected, remove it from the list. If it is a tombstone entry, it needs to be
564 // deleted. Unprotected entries still exist in the unprotected list, so UNPROTECTED
565 // entries should only be removed from the recency list.
566 while (!recency_list_.empty() && recency_list_.front().state() != PROTECTED) {
567 LIRSHandle* oldest = &recency_list_.front();
568 if (oldest->state() == TOMBSTONE) {
569 ToUninitialized(tstate, oldest, /* is_trim */ true);
570 } else {
571 DCHECK_EQ(oldest->state(), UNPROTECTED);
572 recency_list_.pop_front();
573 }
574 }
575}
576
577void LIRSCacheShard::EnforceTombstoneLimit(LIRSThreadState* tstate) {
578 // If there are a large number of entries that haven't been seen before, the number

Callers

nothing calls this directly

Calls 3

frontMethod · 0.80
emptyMethod · 0.45
stateMethod · 0.45

Tested by

no test coverage detected