public class ReplicaOutputStreams extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
ReplicaOutputStreams(OutputStream dataOut,
OutputStream checksumOut,
org.apache.hadoop.util.DataChecksum checksum,
FsVolumeSpi volume,
org.apache.hadoop.hdfs.server.datanode.FileIoProvider fileIoProvider)
Create an object with a data output stream, a checksum output stream
and a checksum.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
closeDataStream() |
void |
dropCacheBehindWrites(String identifier,
long offset,
long len,
int flags) |
void |
flushChecksumOut()
Flush the checksum stream if it supports it.
|
void |
flushDataOut()
Flush the data stream if it supports it.
|
org.apache.hadoop.util.DataChecksum |
getChecksum() |
OutputStream |
getChecksumOut() |
OutputStream |
getDataOut() |
FileDescriptor |
getOutFd() |
boolean |
isTransientStorage() |
void |
syncChecksumOut()
Sync the checksum stream if it supports it.
|
void |
syncDataOut()
Sync the data stream if it supports it.
|
void |
syncFileRangeIfPossible(long offset,
long nbytes,
int flags) |
void |
writeDataToDisk(byte[] b,
int off,
int len) |
public ReplicaOutputStreams(OutputStream dataOut, OutputStream checksumOut, org.apache.hadoop.util.DataChecksum checksum, FsVolumeSpi volume, org.apache.hadoop.hdfs.server.datanode.FileIoProvider fileIoProvider)
public FileDescriptor getOutFd()
public OutputStream getDataOut()
public OutputStream getChecksumOut()
public org.apache.hadoop.util.DataChecksum getChecksum()
public boolean isTransientStorage()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void closeDataStream() throws IOException
IOException
public void syncDataOut() throws IOException
IOException
public void syncChecksumOut() throws IOException
IOException
public void flushDataOut() throws IOException
IOException
public void flushChecksumOut() throws IOException
IOException
public void writeDataToDisk(byte[] b, int off, int len) throws IOException
IOException
public void syncFileRangeIfPossible(long offset, long nbytes, int flags) throws org.apache.hadoop.io.nativeio.NativeIOException
org.apache.hadoop.io.nativeio.NativeIOException
public void dropCacheBehindWrites(String identifier, long offset, long len, int flags) throws org.apache.hadoop.io.nativeio.NativeIOException
org.apache.hadoop.io.nativeio.NativeIOException
Copyright © 2018 Apache Software Foundation. All Rights Reserved.