@InterfaceAudience.Private public interface AsyncFSOutput extends Closeable
The implementation is not required to be thread safe.
Modifier and Type | Method and Description |
---|---|
int |
buffered()
Return the current size of buffered data.
|
void |
close()
Close the file.
|
CompletableFuture<Long> |
flush(boolean sync)
Flush the buffer out.
|
org.apache.hadoop.hdfs.protocol.DatanodeInfo[] |
getPipeline()
Return current pipeline.
|
long |
getSyncedLength()
Returns byteSize success synced to underlying filesystem.
|
boolean |
isBroken()
Whether the stream is broken.
|
void |
recoverAndClose(CancelableProgressable reporter)
The close method when error occurred.
|
void |
write(byte[] b)
Just call write(b, 0, b.length).
|
void |
write(byte[] b,
int off,
int len)
Copy the data into the buffer.
|
void |
write(ByteBuffer bb)
Copy the data in the given
bb into the buffer. |
void |
writeInt(int i)
Write an int to the buffer.
|
void write(byte[] b)
write(byte[], int, int)
void write(byte[] b, int off, int len)
flush(boolean)
to flush the
buffer manually.void writeInt(int i)
void write(ByteBuffer bb)
bb
into the buffer.int buffered()
boolean isBroken()
org.apache.hadoop.hdfs.protocol.DatanodeInfo[] getPipeline()
CompletableFuture<Long> flush(boolean sync)
sync
- persistent the data to devicevoid recoverAndClose(CancelableProgressable reporter) throws IOException
IOException
void close() throws IOException
recoverAndClose(CancelableProgressable)
if this method
throws an exception.close
in interface AutoCloseable
close
in interface Closeable
IOException
long getSyncedLength()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.