@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() |
BlockInfo |
getInfo(long blockId)
Gets the block info of a block, if it exists.
|
BlockInStream |
getInStream(BlockInfo info,
InStreamOptions options,
Map<WorkerNetAddress,Long> failedWorkers)
|
BlockInStream |
getInStream(long blockId,
InStreamOptions options)
Gets a stream to read the data of a block.
|
BlockInStream |
getInStream(long blockId,
InStreamOptions options,
Map<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,
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 BlockInfo getInfo(long blockId) throws IOException
blockId
- the blockId to obtain information aboutBlockInfo
containing the metadata of the blockIOException
public List<BlockWorkerInfo> getEligibleWorkers() throws IOException
IOException
public List<BlockWorkerInfo> getAllWorkers() throws IOException
IOException
public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException
blockId
- the id of the block to readoptions
- the options associated with the read requestIOException
public BlockInStream getInStream(long blockId, InStreamOptions options, Map<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 timeIOException
public BlockInStream getInStream(BlockInfo info, InStreamOptions options, Map<WorkerNetAddress,Long> failedWorkers) throws IOException
info
- the block infooptions
- the options associated with the read requestfailedWorkers
- the map of workers address to most recent failure timeIOException
public BlockOutStream getOutStream(long blockId, long blockSize, 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
fashionIOException
public 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
fashionIOException
public long getCapacityBytes() throws IOException
IOException
public long getUsedBytes() throws IOException
IOException
Copyright © 2023. All Rights Reserved.