public class BlockPageEvictor extends Object implements CacheEvictor
addPinnedBlock(long)
, and later calling removePinnedBlock(long)
makes them eligible for eviction again.Modifier and Type | Method and Description |
---|---|
boolean |
addPinnedBlock(long blockId)
Adds a pinned block that is prevented from eviction.
|
PageId |
evict() |
PageId |
evictMatching(java.util.function.Predicate<PageId> criterion)
Picks the first candidate for eviction that satisfies the given criterion.
|
boolean |
removePinnedBlock(long blockId)
Removes a pinned block that is prevented from eviction.
|
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 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
public boolean addPinnedBlock(long blockId)
removePinnedBlock(long)
is called for that
block.blockId
- block idpublic boolean removePinnedBlock(long blockId)
blockId
- block idCopyright © 2023. All Rights Reserved.