java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable, org.apache.hadoop.fs.statistics.IOStatisticsSource, org.apache.hadoop.fs.StreamCapabilities, org.apache.hadoop.fs.Syncablepublic class AbfsOutputStream
extends java.io.OutputStream
implements org.apache.hadoop.fs.Syncable, org.apache.hadoop.fs.StreamCapabilities, org.apache.hadoop.fs.statistics.IOStatisticsSource
| Constructor | Description |
|---|---|
AbfsOutputStream(AbfsOutputStreamContext abfsOutputStreamContext) |
| Modifier and Type | Method | 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.
|
org.apache.hadoop.fs.statistics.IOStatistics |
getIOStatistics() |
|
AbfsOutputStreamStatistics |
getOutputStreamStatistics() |
Getter method for AbfsOutputStream statistics.
|
java.lang.String |
getStreamID() |
|
int |
getWriteOperationsSize() |
Getter to get the size of the task queue.
|
boolean |
hasCapability(java.lang.String capability) |
Query the stream for a specific capability.
|
boolean |
hasLease() |
|
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).
|
boolean |
isLeaseFreed() |
|
void |
registerListener(Listener listener1) |
|
void |
sync() |
Deprecated.
|
java.lang.String |
toString() |
Appending AbfsOutputStream statistics to base toString().
|
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.
|
public AbfsOutputStream(AbfsOutputStreamContext abfsOutputStreamContext) throws java.io.IOException
java.io.IOExceptionpublic boolean hasCapability(java.lang.String capability)
hasCapability in interface org.apache.hadoop.fs.StreamCapabilitiescapability - string to query the stream support for.public void write(int byteVal)
throws java.io.IOException
write in class java.io.OutputStreambyteVal - the byteValue to write.java.io.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 java.io.IOException
write in class java.io.OutputStreamdata - the byte array to write.off - the start off in the data.length - the number of bytes to write.java.io.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 java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void hsync()
throws java.io.IOException
hsync in interface org.apache.hadoop.fs.Syncablejava.io.IOException - if error occurs@Deprecated
public void sync()
throws java.io.IOException
sync in interface org.apache.hadoop.fs.Syncablejava.io.IOExceptionpublic void hflush()
throws java.io.IOException
hflush in interface org.apache.hadoop.fs.Syncablejava.io.IOException - if any error occurspublic java.lang.String getStreamID()
public void registerListener(Listener listener1)
public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOException@VisibleForTesting
public void waitForPendingUploads()
throws java.io.IOException
java.io.IOException@VisibleForTesting public AbfsOutputStreamStatistics getOutputStreamStatistics()
@VisibleForTesting public int getWriteOperationsSize()
public org.apache.hadoop.fs.statistics.IOStatistics getIOStatistics()
getIOStatistics in interface org.apache.hadoop.fs.statistics.IOStatisticsSource@VisibleForTesting public boolean isLeaseFreed()
@VisibleForTesting public boolean hasLease()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.