@ThreadSafe public class LRUCacheEvictor extends java.lang.Object implements CacheEvictor
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<PageId,java.lang.Boolean> |
mLRUCache |
| Constructor and Description |
|---|
LRUCacheEvictor(CacheEvictorOptions options)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
PageId |
evict() |
PageId |
evictMatching(java.util.function.Predicate<PageId> criterion)
Picks the first candidate for eviction that satisfies the given criterion.
|
void |
reset()
Resets the evictor.
|
void |
updateOnDelete(PageId pageId)
Updates evictor after a delete operation.
|
void |
updateOnGet(PageId pageId)
Updates evictor after a get operation.
|
void |
updateOnPut(PageId pageId)
Updates evictor after a put operation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateprotected final java.util.Map<PageId,java.lang.Boolean> mLRUCache
public LRUCacheEvictor(CacheEvictorOptions options)
options - public void updateOnGet(PageId pageId)
CacheEvictorupdateOnGet in interface CacheEvictorpageId - page identifierpublic void updateOnPut(PageId pageId)
CacheEvictorupdateOnPut in interface CacheEvictorpageId - page identifierpublic void updateOnDelete(PageId pageId)
CacheEvictorupdateOnDelete in interface CacheEvictorpageId - page identifier@Nullable public PageId evict()
evict in interface CacheEvictor@Nullable public PageId evictMatching(java.util.function.Predicate<PageId> criterion)
CacheEvictorevictMatching in interface CacheEvictorcriterion - criterionpublic void reset()
CacheEvictorreset in interface CacheEvictorCopyright © 2022. All Rights Reserved.