public final class TachyonBlockStore extends Object implements Closeable
get()
. The methods in this
class are completely opaque to user input (such as ClientOptions
). This class is thread
safe.Modifier and Type | Method and Description |
---|---|
void |
close() |
static TachyonBlockStore |
get() |
long |
getCapacityBytes()
Gets the total capacity of Tachyon's BlockStore.
|
BlockInfo |
getInfo(long blockId)
Gets the block info of a block, if it exists.
|
BufferedBlockInStream |
getInStream(long blockId)
Gets a stream to read the data of a block.
|
BufferedBlockOutStream |
getOutStream(long blockId,
long blockSize,
String location)
Gets a stream to write data to a block.
|
long |
getUsedBytes()
Gets the used bytes of Tachyon's BlockStore.
|
void |
promote(long blockId)
Attempts to promote a block in Tachyon space.
|
public static TachyonBlockStore get()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public BlockInfo getInfo(long blockId) throws IOException
blockId
- the blockId to obtain information aboutIOException
- if the block does not existpublic BufferedBlockInStream getInStream(long blockId) throws IOException
blockId
- the block to read fromIOException
- if the block does not existpublic BufferedBlockOutStream getOutStream(long blockId, long blockSize, String location) 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 Tachyon again)location
- the worker to write the block to, fails if the worker cannot serve the requestIOException
- if the block cannot be writtenpublic long getCapacityBytes() throws IOException
IOException
public long getUsedBytes() throws IOException
IOException
public void promote(long blockId) throws IOException
blockId
- the id of the block to promoteIOException
- if the block does not existCopyright © 2015. All Rights Reserved.