@ThreadSafe public class RocksBlockStore extends java.lang.Object implements BlockStore
BlockStore.Block, BlockStore.Factory| Constructor and Description |
|---|
RocksBlockStore(java.lang.String baseDir)
Creates and initializes a rocks block store.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLocation(long id,
Block.BlockLocation location)
Adds a new block location.
|
void |
clear()
Removes all metadata from the block store.
|
void |
close()
Closes the block store and releases all resources.
|
java.util.Optional<Block.BlockMeta> |
getBlock(long id) |
java.util.List<Block.BlockLocation> |
getLocations(long id)
Gets locations for a block.
|
java.util.Iterator<BlockStore.Block> |
iterator() |
void |
putBlock(long id,
Block.BlockMeta meta)
Adds block metadata to the block store.
|
void |
removeBlock(long id)
Removes a block, or does nothing if the block does not exist.
|
void |
removeLocation(long blockId,
long workerId)
Removes a block location.
|
public RocksBlockStore(java.lang.String baseDir)
baseDir - the base directory in which to store block store metadatapublic java.util.Optional<Block.BlockMeta> getBlock(long id)
getBlock in interface BlockStoreid - a block idpublic void putBlock(long id,
Block.BlockMeta meta)
BlockStoreputBlock in interface BlockStoreid - the block idmeta - the block metadatapublic void removeBlock(long id)
BlockStoreremoveBlock in interface BlockStoreid - a block id to removepublic void clear()
BlockStoreclear in interface BlockStorepublic void close()
BlockStoreclose in interface BlockStorepublic java.util.List<Block.BlockLocation> getLocations(long id)
BlockStoregetLocations in interface BlockStoreid - a block idpublic void addLocation(long id,
Block.BlockLocation location)
BlockStoreaddLocation in interface BlockStoreid - a block idlocation - a block locationpublic void removeLocation(long blockId,
long workerId)
BlockStoreremoveLocation in interface BlockStoreblockId - a block idworkerId - a worker idpublic java.util.Iterator<BlockStore.Block> iterator()
iterator in interface java.lang.Iterable<BlockStore.Block>Copyright © 2020. All Rights Reserved.