public final class RemoteBlockOutStream extends BufferedBlockOutStream
mBlockId, mBlockSize, mBuffer, mClosed, mContext, mFlushedBytes, mWrittenBytes
Constructor and Description |
---|
RemoteBlockOutStream(long blockId,
long blockSize)
Creates a new block output stream.
|
RemoteBlockOutStream(long blockId,
long blockSize,
String hostname)
Creates a new block output stream on a specific host.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the write to Tachyon storage.
|
void |
close() |
void |
flush() |
protected void |
unBufferedWrite(byte[] b,
int off,
int len)
Writes the data in the byte array directly to the backing store.
|
checkIfClosed, remaining, write, write, write
public RemoteBlockOutStream(long blockId, long blockSize) throws IOException
blockId
- the block idblockSize
- the block sizeIOException
- if I/O error occurspublic RemoteBlockOutStream(long blockId, long blockSize, String hostname) throws IOException
blockId
- the block idblockSize
- the block sizehostname
- the hostname of the preferred workerIOException
- if I/O error occurspublic void cancel() throws IOException
Cancelable
IOException
- if there is a failure when the worker invalidates the cache attemptpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
protected void unBufferedWrite(byte[] b, int off, int len) throws IOException
BufferedBlockOutStream
unBufferedWrite
in class BufferedBlockOutStream
b
- the data that should be writtenoff
- the offset into the data to start writing fromlen
- the length to writeIOException
- if the write does not succeedCopyright © 2015. All Rights Reserved.