Class ReplicaInputStreams
java.lang.Object
org.apache.hadoop.hdfs.server.datanode.fsdataset.ReplicaInputStreams
- All Implemented Interfaces:
Closeable,AutoCloseable
Contains the input streams for the data and checksum of a replica.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReplicaInputStreams(InputStream dataStream, InputStream checksumStream, FsVolumeReference volumeRef, FileIoProvider fileIoProvider) Create an object with a data input stream and a checksum input stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidvoidvoiddropCacheBehindReads(String identifier, long offset, long len, int flags) voidreadChecksumFully(byte[] buf, int off, int len) voidreadDataFully(byte[] buf, int off, int len) voidskipChecksumFully(long len) voidskipDataFully(long len)
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
ReplicaInputStreams
public ReplicaInputStreams(InputStream dataStream, InputStream checksumStream, FsVolumeReference volumeRef, FileIoProvider fileIoProvider) Create an object with a data input stream and a checksum input stream.
-
-
Method Details
-
getDataIn
- Returns:
- the data input stream.
-
getChecksumIn
- Returns:
- the checksum input stream.
-
getDataInFd
-
getVolumeRef
-
readDataFully
- Throws:
IOException
-
readChecksumFully
- Throws:
IOException
-
skipDataFully
- Throws:
IOException
-
skipChecksumFully
- Throws:
IOException
-
closeChecksumStream
- Throws:
IOException
-
dropCacheBehindReads
public void dropCacheBehindReads(String identifier, long offset, long len, int flags) throws org.apache.hadoop.io.nativeio.NativeIOException - Throws:
org.apache.hadoop.io.nativeio.NativeIOException
-
closeStreams
- Throws:
IOException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-