@ThreadSafe public final class AlluxioBlockStore extends Object
AlluxioBlockStore constructors.| Modifier and Type | Method and Description |
|---|---|
static AlluxioBlockStore |
create(FileSystemContext context)
Creates an Alluxio block store with default local hostname.
|
List<BlockWorkerInfo> |
getAllWorkers() |
long |
getCapacityBytes()
Gets the total capacity of Alluxio's BlockStore.
|
List<BlockWorkerInfo> |
getEligibleWorkers() |
alluxio.wire.BlockInfo |
getInfo(long blockId)
Gets the block info of a block, if it exists.
|
BlockInStream |
getInStream(long blockId,
InStreamOptions options)
Gets a stream to read the data of a block.
|
BlockInStream |
getInStream(long blockId,
InStreamOptions options,
Map<alluxio.wire.WorkerNetAddress,Long> failedWorkers)
Gets a stream to read the data of a block.
|
BlockOutStream |
getOutStream(long blockId,
long blockSize,
OutStreamOptions options)
Gets a stream to write data to a block based on the options.
|
BlockOutStream |
getOutStream(long blockId,
long blockSize,
alluxio.wire.WorkerNetAddress address,
OutStreamOptions options)
Gets a stream to write data to a block.
|
long |
getUsedBytes()
Gets the used bytes of Alluxio's BlockStore.
|
public static AlluxioBlockStore create(FileSystemContext context)
context - the file system contextAlluxioBlockStore createdpublic alluxio.wire.BlockInfo getInfo(long blockId)
throws IOException
blockId - the blockId to obtain information aboutBlockInfo containing the metadata of the blockIOExceptionpublic List<BlockWorkerInfo> getEligibleWorkers() throws IOException
IOExceptionpublic List<BlockWorkerInfo> getAllWorkers() throws IOException
IOExceptionpublic BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException
blockId - the id of the block to readoptions - the options associated with the read requestIOExceptionpublic BlockInStream getInStream(long blockId, InStreamOptions options, Map<alluxio.wire.WorkerNetAddress,Long> failedWorkers) throws IOException
blockId - the id of the block to readoptions - the options associated with the read requestfailedWorkers - the map of workers address to most recent failure timeIOExceptionpublic BlockOutStream getOutStream(long blockId, long blockSize, alluxio.wire.WorkerNetAddress address, OutStreamOptions options) throws IOException
blockId - the block to writeblockSize - the standard block size to write, or -1 if the block already exists (and this
stream is just storing the block in Alluxio again)address - the address of the worker to write the block to, fails if the worker cannot
serve the requestoptions - the output stream optionsBlockOutStream which can be used to write data to the block in a streaming
fashionIOExceptionpublic BlockOutStream getOutStream(long blockId, long blockSize, OutStreamOptions options) throws IOException
blockId - the block to writeblockSize - the standard block size to write, or -1 if the block already exists (and this
stream is just storing the block in Alluxio again)options - the output stream optionBlockOutStream which can be used to write data to the block in a streaming
fashionIOExceptionpublic long getCapacityBytes()
throws IOException
IOExceptionpublic long getUsedBytes()
throws IOException
IOExceptionCopyright © 2024. All Rights Reserved.