@ThreadSafe public class DefaultBlockMeta extends Object implements BlockMeta
Constructor and Description |
---|
DefaultBlockMeta(long blockId,
long blockSize,
StorageDir dir)
Creates a new instance of
DefaultBlockMeta . |
DefaultBlockMeta(TempBlockMeta tempBlock)
Creates a new instance of
DefaultBlockMeta from DefaultTempBlockMeta . |
Modifier and Type | Method and Description |
---|---|
static String |
commitPath(StorageDir dir,
long blockId)
Committed block is stored in BlockStore under its
StorageDir as a block file named
after its blockId. |
long |
getBlockId() |
BlockStoreLocation |
getBlockLocation() |
long |
getBlockSize() |
StorageDir |
getParentDir() |
String |
getPath() |
public DefaultBlockMeta(long blockId, long blockSize, StorageDir dir)
DefaultBlockMeta
.blockId
- the block idblockSize
- the block sizedir
- the parent directorypublic DefaultBlockMeta(TempBlockMeta tempBlock)
DefaultBlockMeta
from DefaultTempBlockMeta
.tempBlock
- uncommitted block metadatapublic static String commitPath(StorageDir dir, long blockId)
StorageDir
as a block file named
after its blockId. e.g. Block 100 of StorageDir "/mnt/mem/0" has path:
/mnt/mem/0/100
blockId
- the block iddir
- the parent directorypublic long getBlockId()
getBlockId
in interface BlockMeta
public BlockStoreLocation getBlockLocation()
getBlockLocation
in interface BlockMeta
public long getBlockSize()
getBlockSize
in interface BlockMeta
public String getPath()
public StorageDir getParentDir()
getParentDir
in interface BlockMeta
Copyright © 2023. All Rights Reserved.