@ThreadSafe public class LFUCacheEvictor extends Object implements CacheEvictor
Constructor and Description |
---|
LFUCacheEvictor(CacheEvictorOptions options)
Required 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, wait
create
public LFUCacheEvictor(CacheEvictorOptions options)
options
- public void updateOnGet(PageId pageId)
CacheEvictor
updateOnGet
in interface CacheEvictor
pageId
- page identifierpublic void updateOnPut(PageId pageId)
CacheEvictor
updateOnPut
in interface CacheEvictor
pageId
- page identifierpublic void updateOnDelete(PageId pageId)
CacheEvictor
updateOnDelete
in interface CacheEvictor
pageId
- page identifier@Nullable public PageId evict()
evict
in interface CacheEvictor
@Nullable public PageId evictMatching(java.util.function.Predicate<PageId> criterion)
CacheEvictor
evictMatching
in interface CacheEvictor
criterion
- criterionpublic void reset()
CacheEvictor
reset
in interface CacheEvictor
Copyright © 2023. All Rights Reserved.