public class ClockProPlusEviction extends AbstractEviction
This version uses a static allocation for hot and cold space sizes. No online or dynamic optimization is done yet. However, the hit rate for all measured access traces is better then LRU and it is resistant to scans.
| Modifier and Type | Class and Description |
|---|---|
static class |
ClockProPlusEviction.Tunable |
correctedMaxSize, heapCache, MAXIMAL_CHUNK_SIZE, maxSize, MINIMAL_CHUNK_SIZE, MINIMUM_CAPACITY_FOR_CHUNKING| Constructor and Description |
|---|
ClockProPlusEviction(HeapCache _heapCache,
HeapCacheListener _listener,
long _maxSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkIntegrity(IntegrityState is) |
protected Entry |
findEvictionCandidate(Entry _previous)
Runs cold hand an in turn hot hand to find eviction candidate.
|
String |
getExtraStatistics()
Fragment that the eviction wants to add to the
Cache.toString() output. |
long |
getHitCount()
Number of recorded hits.
|
long |
getSize()
Number of entries in the eviction data structure
|
protected void |
insertIntoReplacementList(Entry e) |
long |
removeAll()
Remove all entries from the eviction data structure.
|
protected void |
removeFromReplacementList(Entry e)
Remove, expire or eviction of an entry happens.
|
void |
removeFromReplacementListOnEvict(Entry e)
Track the entry on the ghost list and call the usual remove procedure.
|
close, drain, evictEventually, evictEventually, getEvictedCount, getEvictionRunningCount, getExpiredRemovedCount, getMaxSize, getMetrics, getNewEntryCount, getRemovedCount, getVirginRemovedCount, runLocked, start, stop, submitWithoutEvictionpublic ClockProPlusEviction(HeapCache _heapCache, HeapCacheListener _listener, long _maxSize)
public long getHitCount()
EvictionMetricspublic long removeAll()
Evictionpublic void removeFromReplacementListOnEvict(Entry e)
removeFromReplacementListOnEvict in class AbstractEvictionprotected void removeFromReplacementList(Entry e)
Why don't generate ghosts here? If the entry is removed because of a programmatic remove or expiry we should not occupy any resources. Removing and expiry may also take place when no eviction is needed at all, which happens when the cache size did not hit the maximum yet. Producing ghosts would add additional overhead, when it is not needed.
removeFromReplacementList in class AbstractEvictionpublic long getSize()
EvictionMetricsprotected void insertIntoReplacementList(Entry e)
insertIntoReplacementList in class AbstractEvictionprotected Entry findEvictionCandidate(Entry _previous)
findEvictionCandidate in class AbstractEviction_previous - null or previous found eviction candidate returned by this method.
This is currently not used by the implemented eviction methods
but might be in the future.public void checkIntegrity(IntegrityState is)
public String getExtraStatistics()
EvictionMetricsCache.toString() output.getExtraStatistics in interface EvictionMetricsgetExtraStatistics in class AbstractEvictioncache2k API documentation. Copyright © 2000–2019 headissue GmbH, Munich.