Interface AsyncFSOutput
- All Superinterfaces:
- AutoCloseable,- Closeable
- All Known Implementing Classes:
- FanOutOneBlockAsyncDFSOutput,- WrapperAsyncFSOutput
Interface for asynchronous filesystem output stream.
 
The implementation is not required to be thread safe.
- 
Method SummaryModifier and TypeMethodDescriptionintbuffered()Return the current size of buffered data.voidclose()Close the file.flush(boolean sync) Flush the buffer out.org.apache.hadoop.hdfs.protocol.DatanodeInfo[]Return current pipeline.longReturns byteSize success synced to underlying filesystem.booleanisBroken()Whether the stream is broken.voidrecoverAndClose(CancelableProgressable reporter) The close method when error occurred.voidwrite(byte[] b) Just call write(b, 0, b.length).voidwrite(byte[] b, int off, int len) Copy the data into the buffer.voidwrite(ByteBuffer bb) Copy the data in the givenbbinto the buffer.voidwriteInt(int i) Write an int to the buffer.
- 
Method Details- 
writeJust call write(b, 0, b.length).- See Also:
 
- 
writeCopy the data into the buffer. Note that you need to callflush(boolean)to flush the buffer manually.
- 
writeIntWrite an int to the buffer.
- 
writeCopy the data in the givenbbinto the buffer.
- 
bufferedint buffered()Return the current size of buffered data.
- 
isBrokenboolean isBroken()Whether the stream is broken.
- 
getPipelineorg.apache.hadoop.hdfs.protocol.DatanodeInfo[] getPipeline()Return current pipeline. Empty array if no pipeline.
- 
flushFlush the buffer out.- Parameters:
- sync- persistent the data to device
- Returns:
- A CompletableFuture that hold the acked length after flushing.
 
- 
recoverAndCloseThe close method when error occurred.- Throws:
- IOException
 
- 
closeClose the file. You should callrecoverAndClose(CancelableProgressable)if this method throws an exception.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
- 
getSyncedLengthlong getSyncedLength()Returns byteSize success synced to underlying filesystem.
 
-