@InterfaceAudience.Private public class WrapperAsyncFSOutput extends Object implements AsyncFSOutput
AsyncFSOutput wraps a FSDataOutputStream.| 构造器和说明 |
|---|
WrapperAsyncFSOutput(org.apache.hadoop.fs.Path file,
org.apache.hadoop.fs.FSDataOutputStream out) |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
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.
|
public WrapperAsyncFSOutput(org.apache.hadoop.fs.Path file,
org.apache.hadoop.fs.FSDataOutputStream out)
public void write(byte[] b)
AsyncFSOutputwrite 在接口中 AsyncFSOutputAsyncFSOutput.write(byte[], int, int)public void write(byte[] b,
int off,
int len)
AsyncFSOutputAsyncFSOutput.flush(boolean) to flush the
buffer manually.write 在接口中 AsyncFSOutputpublic void writeInt(int i)
AsyncFSOutputwriteInt 在接口中 AsyncFSOutputpublic void write(ByteBuffer bb)
AsyncFSOutputbb into the buffer.write 在接口中 AsyncFSOutputpublic int buffered()
AsyncFSOutputbuffered 在接口中 AsyncFSOutputpublic org.apache.hadoop.hdfs.protocol.DatanodeInfo[] getPipeline()
AsyncFSOutputgetPipeline 在接口中 AsyncFSOutputpublic CompletableFuture<Long> flush(boolean sync)
AsyncFSOutputflush 在接口中 AsyncFSOutputsync - persistent the data to devicepublic void recoverAndClose(CancelableProgressable reporter) throws IOException
AsyncFSOutputrecoverAndClose 在接口中 AsyncFSOutputIOExceptionpublic void close()
throws IOException
AsyncFSOutputAsyncFSOutput.recoverAndClose(CancelableProgressable) if this method
throws an exception.close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在接口中 AsyncFSOutputIOExceptionpublic boolean isBroken()
AsyncFSOutputisBroken 在接口中 AsyncFSOutputCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.