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

Method UnprotectedToProtected

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

Source from the content-addressed store, hash-verified

674}
675
676void LIRSCacheShard::UnprotectedToProtected(LIRSThreadState* tstate, LIRSHandle *e) {
677 // This only happens for entries that are only the recency list
678 DCHECK(e->recency_list_hook_.is_linked());
679 // Make this the most recent entry in the recency list and remove from the
680 // unprotected list.
681 MoveToRecencyListBack(tstate, e);
682 RemoveFromUnprotectedList(e);
683 e->set_state(UNPROTECTED, PROTECTED);
684 // List operations happen before changes to the counts/usage
685 --num_unprotected_;
686 ++num_protected_;
687 // Transfer the usage
688 unprotected_usage_ -= e->charge();
689 protected_usage_ += e->charge();
690 // If necessary, evict old entries from the recency list, protected to unprotected
691 EnforceProtectedCapacity(tstate);
692}
693
694void LIRSCacheShard::ProtectedToUnprotected(LIRSThreadState* tstate, LIRSHandle* e) {
695 DCHECK(!e->unprotected_tombstone_list_hook_.is_linked());

Callers

nothing calls this directly

Calls 2

chargeMethod · 0.80
set_stateMethod · 0.45

Tested by

no test coverage detected