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 Closeableclose in interface AutoCloseablepublic void closeDataStream()
throws IOException
IOExceptionpublic void syncDataOut()
throws IOException
IOExceptionpublic void syncChecksumOut()
throws IOException
IOExceptionpublic void flushDataOut()
throws IOException
IOExceptionpublic void flushChecksumOut()
throws IOException
IOExceptionpublic void writeDataToDisk(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic void syncFileRangeIfPossible(long offset,
long nbytes,
int flags)
throws org.apache.hadoop.io.nativeio.NativeIOException
org.apache.hadoop.io.nativeio.NativeIOExceptionpublic void dropCacheBehindWrites(String identifier, long offset, long len, int flags) throws org.apache.hadoop.io.nativeio.NativeIOException
org.apache.hadoop.io.nativeio.NativeIOExceptionCopyright © 2008–2024 Apache Software Foundation. All rights reserved.