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

Method ProtectedToUnprotected

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

Source from the content-addressed store, hash-verified

692}
693
694void LIRSCacheShard::ProtectedToUnprotected(LIRSThreadState* tstate, LIRSHandle* e) {
695 DCHECK(!e->unprotected_tombstone_list_hook_.is_linked());
696 DCHECK(e->recency_list_hook_.is_linked());
697 // Must be the oldest on the recency list
698 DCHECK(&recency_list_.front() == e);
699 recency_list_.erase(recency_list_.iterator_to(*e));
700 // Trim the recency list after the removal
701 TrimRecencyList(tstate);
702 e->set_state(PROTECTED, UNPROTECTED);
703 // Add to unprotected list as the newest entry
704 AddToUnprotectedList(e);
705 // List operations happen before changes to the counts/usage
706 --num_protected_;
707 ++num_unprotected_;
708 // Transfer the usage
709 protected_usage_ -= e->charge();
710 unprotected_usage_ += e->charge();
711 // If necessary, evict an entry from the unprotected list
712 EnforceUnprotectedCapacity(tstate);
713}
714
715void LIRSCacheShard::UnprotectedToTombstone(LIRSThreadState* tstate, LIRSHandle* e) {
716 // Decrement unprotected usage

Callers

nothing calls this directly

Calls 4

frontMethod · 0.80
eraseMethod · 0.80
chargeMethod · 0.80
set_stateMethod · 0.45

Tested by

no test coverage detected