@NotThreadSafe @Deprecated public class LRUEvictor extends AbstractEvictor
Evictor.Factory, Evictor.Mode
Modifier and Type | Field and Description |
---|---|
protected Map<Long,Boolean> |
mLRUCache
Deprecated.
Access-ordered
LinkedHashMap from blockId to UNUSED_MAP_VALUE (just a
placeholder to occupy the value), acts as a LRU double linked list where most recently accessed
element is put at the tail while least recently accessed element is put at the head. |
mAllocator, mMetadataView
Constructor and Description |
---|
LRUEvictor(BlockMetadataEvictorView view,
Allocator allocator)
Deprecated.
Creates a new instance of
LRUEvictor . |
Modifier and Type | Method and Description |
---|---|
protected Iterator<Long> |
getBlockIterator()
Deprecated.
Returns an iterator for evictor cache blocks.
|
void |
onAccessBlock(long blockId)
Deprecated.
Actions when accessing a block.
|
void |
onBlockLost(long blockId)
Deprecated.
Actions when a block is lost.
|
void |
onCommitBlockToLocal(long blockId,
BlockStoreLocation location)
Deprecated.
Actions when committing a temporary block to a
BlockStoreLocation at local block store. |
void |
onRemoveBlockByClient(long blockId)
Deprecated.
Actions when removing an existing block.
|
void |
onRemoveBlockByWorker(long blockId)
Deprecated.
Actions when removing an existing block by worker.
|
protected void |
onRemoveBlockFromIterator(long blockId)
Deprecated.
Performs additional cleanup when a block is removed from the iterator returned by
AbstractEvictor.getBlockIterator() . |
cascadingEvict, freeSpaceWithView, freeSpaceWithView
onAbortBlock, onAccessBlock, onCommitBlockToMaster, onMoveBlockByClient, onMoveBlockByWorker, onRemoveBlock, onStorageLost, onStorageLost
protected Map<Long,Boolean> mLRUCache
LinkedHashMap
from blockId to UNUSED_MAP_VALUE
(just a
placeholder to occupy the value), acts as a LRU double linked list where most recently accessed
element is put at the tail while least recently accessed element is put at the head.public LRUEvictor(BlockMetadataEvictorView view, Allocator allocator)
LRUEvictor
.view
- a view of block metadata informationallocator
- an allocation policyprotected Iterator<Long> getBlockIterator()
AbstractEvictor
LRUEvictor
returns an iterator
that iterates through the block ids in LRU order.getBlockIterator
in class AbstractEvictor
public void onAccessBlock(long blockId)
BlockStoreEventListener
onAccessBlock
in interface BlockStoreEventListener
onAccessBlock
in class AbstractBlockStoreEventListener
blockId
- the id of the block to accesspublic void onCommitBlockToLocal(long blockId, BlockStoreLocation location)
BlockStoreEventListener
BlockStoreLocation
at local block store.onCommitBlockToLocal
in interface BlockStoreEventListener
onCommitBlockToLocal
in class AbstractBlockStoreEventListener
blockId
- the id of the block to commitlocation
- the location of the block to be committedpublic void onRemoveBlockByClient(long blockId)
BlockStoreEventListener
onRemoveBlockByClient
in interface BlockStoreEventListener
onRemoveBlockByClient
in class AbstractBlockStoreEventListener
blockId
- the id of the block to be removedpublic void onRemoveBlockByWorker(long blockId)
BlockStoreEventListener
onRemoveBlockByWorker
in interface BlockStoreEventListener
onRemoveBlockByWorker
in class AbstractBlockStoreEventListener
blockId
- the id of the block to be removedpublic void onBlockLost(long blockId)
BlockStoreEventListener
onBlockLost
in interface BlockStoreEventListener
onBlockLost
in class AbstractBlockStoreEventListener
blockId
- the id of the lost blockprotected void onRemoveBlockFromIterator(long blockId)
AbstractEvictor
AbstractEvictor.getBlockIterator()
.onRemoveBlockFromIterator
in class AbstractEvictor
Copyright © 2023. All Rights Reserved.