public class SegmentedEviction extends Object implements Eviction, EvictionMetrics
Constructor and Description |
---|
SegmentedEviction(Eviction[] _segments) |
Modifier and Type | Method and Description |
---|---|
void |
checkIntegrity(IntegrityState _integrityState) |
void |
close()
Free resources, for example thread pool or queue.
|
boolean |
drain()
Drain eviction queue and do updates in the eviction data structures.
|
void |
evictEventually()
Evict if needed, checks all segments.
|
void |
evictEventually(int hc)
Evict if needed, focused on the segment addressed by the hash code.
|
long |
getEvictedCount()
Number of entries evicted
|
int |
getEvictionRunningCount()
Number of eviction currently going on
|
long |
getExpiredRemovedCount()
Removed entries, because expired
|
String |
getExtraStatistics()
Fragment that the eviction wants to add to the
Cache.toString() output. |
long |
getHitCount()
Number of recorded hits.
|
long |
getMaxSize()
Size limit after eviction kicks in
|
EvictionMetrics |
getMetrics() |
long |
getNewEntryCount() |
long |
getRemovedCount() |
long |
getSize()
Number of entries in the eviction data structure
|
long |
getVirginRemovedCount()
Removal of an entry that was never used
|
long |
removeAll()
Remove all entries from the eviction data structure.
|
<T> T |
runLocked(Job<T> j)
Runs job making sure concurrent evictions operations pause.
|
void |
start()
Start concurrent eviction threads.
|
void |
stop()
Stop concurrent threads that may access the eviction data structures.
|
void |
submit(Entry e)
Submit to eviction for inserting or removing from the replacement list.
|
boolean |
submitWithoutEviction(Entry e)
Submit to eviction for inserting or removing from the replacement list.
|
public SegmentedEviction(Eviction[] _segments)
public void submit(Entry e)
Eviction
Whether the entry is inserted or removed is detected via the entry
state Entry.isNotYetInsertedInReplacementList()
.
public boolean submitWithoutEviction(Entry e)
Eviction
submitWithoutEviction
in interface Eviction
public void evictEventually(int hc)
Eviction
evictEventually
in interface Eviction
public void evictEventually()
Eviction
evictEventually
in interface Eviction
public long removeAll()
Eviction
public void start()
Eviction
public void stop()
Eviction
public void close()
Eviction
public boolean drain()
Eviction
public <T> T runLocked(Job<T> j)
Eviction
public void checkIntegrity(IntegrityState _integrityState)
checkIntegrity
in interface Eviction
public EvictionMetrics getMetrics()
getMetrics
in interface Eviction
public String getExtraStatistics()
EvictionMetrics
Cache.toString()
output.getExtraStatistics
in interface EvictionMetrics
public long getHitCount()
EvictionMetrics
getHitCount
in interface EvictionMetrics
public long getNewEntryCount()
getNewEntryCount
in interface EvictionMetrics
InternalCacheInfo.getNewEntryCount()
public long getRemovedCount()
getRemovedCount
in interface EvictionMetrics
InternalCacheInfo.getRemoveCount()
public long getExpiredRemovedCount()
EvictionMetrics
getExpiredRemovedCount
in interface EvictionMetrics
InternalCacheInfo.getExpiredCount()
public long getVirginRemovedCount()
EvictionMetrics
getVirginRemovedCount
in interface EvictionMetrics
public long getEvictedCount()
EvictionMetrics
getEvictedCount
in interface EvictionMetrics
InternalCacheInfo.getEvictedCount()
public long getSize()
EvictionMetrics
getSize
in interface EvictionMetrics
public long getMaxSize()
EvictionMetrics
getMaxSize
in interface EvictionMetrics
public int getEvictionRunningCount()
EvictionMetrics
getEvictionRunningCount
in interface EvictionMetrics
cache2k API documentation. Copyright © 2000–2018 headissue GmbH, Munich.