Package com.tangosol.net.cache
Class CompactSerializationCache.LFUEvictionPolicy
java.lang.Object
com.tangosol.net.cache.CompactSerializationCache.InternalEvictionPolicy
com.tangosol.net.cache.CompactSerializationCache.LFUEvictionPolicy
- All Implemented Interfaces:
ConfigurableCacheMap.EvictionPolicy
- Enclosing class:
CompactSerializationCache
protected class CompactSerializationCache.LFUEvictionPolicy
extends CompactSerializationCache.InternalEvictionPolicy
An EvictionPolicy implementing the Least Frequently Used (LFU) algorithm.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.net.cache.CompactSerializationCache.InternalEvictionPolicy
CompactSerializationCache.InternalEvictionPolicy.EvictionCandidate, CompactSerializationCache.InternalEvictionPolicy.EvictionVisitor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CompactSerializationCache.TouchCountVisitor
The singleton TouchCountVisitor (eviction is single-threaded).Fields inherited from class com.tangosol.net.cache.CompactSerializationCache.InternalEvictionPolicy
f_visitorTouchCount, f_visitorTouchTime, m_ldtLastEvict
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected long
calculateWeight
(Binary binKey) Calculate the "weight" of the entry associated with the specified key.protected ConfigurableCacheMap.EvictionPolicy
Return theconfigured
EvictionPolicy instance.Methods inherited from class com.tangosol.net.cache.CompactSerializationCache.InternalEvictionPolicy
entryTouched, entryTouched, getName, requestEviction, touchInternal
-
Field Details
-
f_visitor
The singleton TouchCountVisitor (eviction is single-threaded).
-
-
Constructor Details
-
LFUEvictionPolicy
protected LFUEvictionPolicy()
-
-
Method Details
-
calculateWeight
Calculate the "weight" of the entry associated with the specified key. The weight is a quantitative measure of how to prioritize the eviction of this entry w.r.t. the other cache entries. Entries with a smaller weights are of higher priority and are preferred over entries with larger weights for eviction.- Specified by:
calculateWeight
in classCompactSerializationCache.InternalEvictionPolicy
- Parameters:
binKey
- the key to calculate the weight for- Returns:
- the weight of the entry
-
getConfiguredPolicy
Return theconfigured
EvictionPolicy instance.- Specified by:
getConfiguredPolicy
in classCompactSerializationCache.InternalEvictionPolicy
- Returns:
- the configured EvictionPolicy
-