public class AbfsOutputStream extends OutputStream implements org.apache.hadoop.fs.Syncable, org.apache.hadoop.fs.StreamCapabilities
| Constructor and Description |
|---|
AbfsOutputStream(AbfsClient client,
String path,
long position,
int bufferSize,
boolean supportFlush) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Force all data in the output stream to be written to Azure storage.
|
void |
flush()
Flushes this output stream and forces any buffered output bytes to be
written out.
|
boolean |
hasCapability(String capability)
Query the stream for a specific capability.
|
void |
hflush()
Flush out the data in client's user buffer.
|
void |
hsync()
Similar to posix fsync, flush out the data in client's user buffer
all the way to the disk device (but the disk may have it in its cache).
|
void |
waitForPendingUploads() |
void |
write(byte[] data,
int off,
int length)
Writes length bytes from the specified byte array starting at off to
this output stream.
|
void |
write(int byteVal)
Writes the specified byte to this output stream.
|
writepublic AbfsOutputStream(AbfsClient client, String path, long position, int bufferSize, boolean supportFlush)
public boolean hasCapability(String capability)
hasCapability in interface org.apache.hadoop.fs.StreamCapabilitiescapability - string to query the stream support for.public void write(int byteVal)
throws IOException
write in class OutputStreambyteVal - the byteValue to write.IOException - if an I/O error occurs. In particular, an IOException may be
thrown if the output stream has been closed.public void write(byte[] data,
int off,
int length)
throws IOException
write in class OutputStreamdata - the byte array to write.off - the start off in the data.length - the number of bytes to write.IOException - if an I/O error occurs. In particular, an IOException may be
thrown if the output stream has been closed.public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void hsync()
throws IOException
hsync in interface org.apache.hadoop.fs.SyncableIOException - if error occurspublic void hflush()
throws IOException
hflush in interface org.apache.hadoop.fs.SyncableIOException - if any error occurspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void waitForPendingUploads()
throws IOException
IOExceptionCopyright © 2008–2020 Apache Software Foundation. All rights reserved.