@NotThreadSafe public final class StorageDirView extends Object
StorageDir
to provide more limited access and a filtered list
of blocks.Constructor and Description |
---|
StorageDirView(StorageDir dir,
StorageTierView tierView,
BlockMetadataManagerView managerView)
|
Modifier and Type | Method and Description |
---|---|
void |
clearBlockMarks()
Clears all marks about blocks to move in/out in this view.
|
TempBlockMeta |
createTempBlockMeta(long sessionId,
long blockId,
long initialBlockSize)
Creates a
TempBlockMeta given sessionId, blockId, and initialBlockSize. |
long |
getAvailableBytes()
Gets available bytes for this dir.
|
long |
getCapacityBytes()
Gets capacity bytes for this dir.
|
long |
getCommittedBytes()
Gets committed bytes for this dir.
|
int |
getDirViewIndex()
Gets the index of this Dir.
|
List<BlockMeta> |
getEvictableBlocks()
Gets a filtered list of block metadata, for blocks that are neither pinned or being blocked.
|
long |
getEvitableBytes()
Gets evictable bytes for this dir, i.e., the total bytes of total evictable blocks.
|
StorageTierView |
getParentTierView() |
boolean |
isMarkedToMoveOut(long blockId)
Returns an indication whether the given block is marked to be moved out.
|
void |
markBlockMoveIn(long blockId,
long blockSize)
Marks a block to move into this dir view, which is used by the evictor.
|
void |
markBlockMoveOut(long blockId,
long blockSize)
Marks a block to move out of this dir view, which is used by the evictor.
|
BlockStoreLocation |
toBlockStoreLocation()
Creates a
BlockStoreLocation for this directory view. |
public StorageDirView(StorageDir dir, StorageTierView tierView, BlockMetadataManagerView managerView)
dir
- which the dirView is constructed fromtierView
- which the dirView is undermanagerView
- which the dirView is associated withpublic int getDirViewIndex()
public List<BlockMeta> getEvictableBlocks()
public long getCapacityBytes()
public long getAvailableBytes()
public long getCommittedBytes()
public long getEvitableBytes()
public void clearBlockMarks()
public TempBlockMeta createTempBlockMeta(long sessionId, long blockId, long initialBlockSize)
TempBlockMeta
given sessionId, blockId, and initialBlockSize.sessionId
- of the owning sessionblockId
- of the new blockinitialBlockSize
- of the new blockTempBlockMeta
under the underlying directorypublic StorageTierView getParentTierView()
public boolean isMarkedToMoveOut(long blockId)
blockId
- the block IDpublic void markBlockMoveIn(long blockId, long blockSize)
blockId
- the Id of the blockblockSize
- the block sizepublic void markBlockMoveOut(long blockId, long blockSize)
blockId
- the Id of the blockblockSize
- the block sizepublic BlockStoreLocation toBlockStoreLocation()
BlockStoreLocation
for this directory view. Redirecting to
StorageDir.toBlockStoreLocation()
BlockStoreLocation
createdCopyright © 2023. All Rights Reserved.