@InterfaceAudience.Public @InterfaceStability.Stable public class FSDataOutputStream extends DataOutputStream implements Syncable, CanSetDropBehind, StreamCapabilities, org.apache.hadoop.fs.statistics.IOStatisticsSource, Abortable
OutputStream in a DataOutputStream.writtenoutABORTABLE_STREAM, DROPBEHIND, HFLUSH, HSYNC, IOSTATISTICS, PREADBYTEBUFFER, READAHEAD, READBYTEBUFFER, UNBUFFER| Constructor and Description |
|---|
FSDataOutputStream(OutputStream out,
org.apache.hadoop.fs.FileSystem.Statistics stats) |
FSDataOutputStream(OutputStream out,
org.apache.hadoop.fs.FileSystem.Statistics stats,
long startPosition) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.hadoop.fs.Abortable.AbortableResult |
abort()
Invoke
abort() on the wrapped stream if it
is Abortable, otherwise raise an
UnsupportedOperationException. |
void |
close()
Close the underlying output stream.
|
IOStatistics |
getIOStatistics()
Get the IO Statistics of the nested stream, falling back to
empty statistics if the stream does not implement the interface
IOStatisticsSource. |
long |
getPos()
Get the current position in the output stream.
|
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 |
setDropBehind(Boolean dropBehind)
Configure whether the stream should drop the cache.
|
String |
toString() |
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFwriteclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitwritepublic FSDataOutputStream(OutputStream out, org.apache.hadoop.fs.FileSystem.Statistics stats)
public FSDataOutputStream(OutputStream out, org.apache.hadoop.fs.FileSystem.Statistics stats, long startPosition)
public long getPos()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterOutputStreamIOExceptionpublic boolean hasCapability(String capability)
StreamCapabilitieshasCapability in interface StreamCapabilitiescapability - string to query the stream support for.public void hflush()
throws IOException
Syncablehflush in interface SyncableIOException - if any error occurspublic void hsync()
throws IOException
Syncablehsync in interface SyncableIOException - if error occurspublic void setDropBehind(Boolean dropBehind) throws IOException
CanSetDropBehindsetDropBehind in interface CanSetDropBehinddropBehind - Whether to drop the cache. null means to use the
default value.IOException - If there was an error changing the dropBehind
setting.
UnsupportedOperationException If this stream doesn't support
setting the drop-behind.public IOStatistics getIOStatistics()
IOStatisticsSource.getIOStatistics in interface org.apache.hadoop.fs.statistics.IOStatisticsSourcepublic org.apache.hadoop.fs.Abortable.AbortableResult abort()
abort() on the wrapped stream if it
is Abortable, otherwise raise an
UnsupportedOperationException.abort in interface AbortableUnsupportedOperationException - if not available.Copyright © 2022 Apache Software Foundation. All rights reserved.