@ThreadSafe
public final class BlockStoreClient
extends java.lang.Object
BlockStoreClient constructors.| Modifier and Type | Method and Description |
|---|---|
static BlockStoreClient |
create(FileSystemContext context)
Creates an Alluxio block store with default local hostname.
|
long |
getCapacityBytes()
Gets the total capacity of Alluxio's BlockStore.
|
Pair<WorkerNetAddress,BlockInStream.BlockInStreamSource> |
getDataSourceAndType(BlockInfo info,
URIStatus status,
BlockLocationPolicy policy,
java.util.Map<WorkerNetAddress,java.lang.Long> failedWorkers)
Gets the data source and type of data source of a block.
|
BlockInfo |
getInfo(long blockId)
Gets the block info of a block, if it exists.
|
BlockInStream |
getInStream(BlockInfo info,
InStreamOptions options,
java.util.Map<WorkerNetAddress,java.lang.Long> failedWorkers)
|
BlockInStream |
getInStream(long blockId,
InStreamOptions options)
Gets a stream to read the data of a block.
|
BlockInStream |
getInStream(long blockId,
InStreamOptions options,
java.util.Map<WorkerNetAddress,java.lang.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 BlockStoreClient create(FileSystemContext context)
context - the file system contextBlockStoreClient createdpublic BlockInfo getInfo(long blockId) throws java.io.IOException
blockId - the blockId to obtain information aboutBlockInfo containing the metadata of the blockjava.io.IOExceptionpublic BlockInStream getInStream(long blockId, InStreamOptions options) throws java.io.IOException
blockId - the id of the block to readoptions - the options associated with the read requestjava.io.IOExceptionpublic BlockInStream getInStream(long blockId, InStreamOptions options, java.util.Map<WorkerNetAddress,java.lang.Long> failedWorkers) throws java.io.IOException
blockId - the id of the block to readoptions - the options associated with the read requestfailedWorkers - the map of workers addresses to most recent failure timejava.io.IOExceptionpublic BlockInStream getInStream(BlockInfo info, InStreamOptions options, java.util.Map<WorkerNetAddress,java.lang.Long> failedWorkers) throws java.io.IOException
info - the block infooptions - the options associated with the read requestfailedWorkers - the map of workers addresses to most recent failure timejava.io.IOExceptionpublic Pair<WorkerNetAddress,BlockInStream.BlockInStreamSource> getDataSourceAndType(BlockInfo info, URIStatus status, BlockLocationPolicy policy, java.util.Map<WorkerNetAddress,java.lang.Long> failedWorkers) throws java.io.IOException
info - the info of the block to readstatus - the URIStatus associated with the read requestpolicy - the policy determining the Alluxio worker locationfailedWorkers - the map of workers addresses to most recent failure timejava.io.IOExceptionpublic BlockOutStream getOutStream(long blockId, long blockSize, WorkerNetAddress address, OutStreamOptions options) throws java.io.IOException
blockId - the block to writeblockSize - the standard block size to writeaddress - 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
fashionjava.io.IOExceptionpublic BlockOutStream getOutStream(long blockId, long blockSize, OutStreamOptions options) throws java.io.IOException
blockId - the block to writeblockSize - the standard block size to writeoptions - the output stream optionBlockOutStream which can be used to write data to the block in a streaming
fashionjava.io.IOExceptionpublic long getCapacityBytes()
throws java.io.IOException
java.io.IOExceptionpublic long getUsedBytes()
throws java.io.IOException
java.io.IOExceptionCopyright © 2022. All Rights Reserved.