@InterfaceAudience.Private public class DFSOutputStream extends FSOutputSummer implements Syncable, CanSetDropBehind
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkClosed()
Check if the implementing OutputStream is closed and should no longer
accept writes.
|
void |
close()
Closes this output stream and releases any system
resources associated with this stream.
|
int |
getCurrentBlockReplication()
Note that this is not a public API;
use
HdfsDataOutputStream.getCurrentBlockReplication() instead. |
int |
getNumCurrentReplicas()
Deprecated.
|
DatanodeInfo[] |
getPipeline() |
void |
hflush()
Flushes out to all replicas of the block.
|
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 |
hsync(EnumSet<HdfsDataOutputStream.SyncFlag> syncFlags)
The expected semantics is all data have flushed out to all replicas
and all replicas have done posix fsync equivalent - ie the OS has
flushed it to the disk device (but the disk may have it in its cache).
|
void |
setArtificialSlowdown(long period) |
void |
setChunksPerPacket(int value) |
void |
setDropBehind(Boolean dropBehind)
Configure whether the stream should drop the cache.
|
void |
sync()
Deprecated.
|
protected void |
writeChunk(byte[] b,
int offset,
int len,
byte[] checksum) |
convertToByteStream, flushBuffer, flushBuffer, getBufferedDataSize, resetChecksumChunk, write, writeflush, writeprotected void checkClosed()
throws IOException
FSOutputSummerIOException if it is closed.checkClosed in class FSOutputSummerIOException - if this stream is already closed.public DatanodeInfo[] getPipeline()
protected void writeChunk(byte[] b,
int offset,
int len,
byte[] checksum)
throws IOException
writeChunk in class FSOutputSummerIOException@Deprecated public void sync() throws IOException
sync in interface SyncableIOExceptionSyncable.hflush()public void hflush()
throws IOException
hflush in interface SyncableIOException - if any error occurspublic void hsync()
throws IOException
Syncablehsync in interface SyncableIOException - if error occurspublic void hsync(EnumSet<HdfsDataOutputStream.SyncFlag> syncFlags) throws IOException
CreateFlag.SYNC_BLOCK.syncFlags - Indicate the semantic of the sync. Currently used to specify
whether or not to update the block length in NameNode.IOException@Deprecated public int getNumCurrentReplicas() throws IOException
HdfsDataOutputStream.getCurrentBlockReplication().IOExceptionpublic int getCurrentBlockReplication()
throws IOException
HdfsDataOutputStream.getCurrentBlockReplication() instead.IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void setArtificialSlowdown(long period)
public void setChunksPerPacket(int value)
public 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.Copyright © 2013 Apache Software Foundation. All rights reserved.