Package alluxio.underfs.hdfs
Class HdfsPositionedUnderFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- alluxio.underfs.SeekableUnderFileInputStream
-
- alluxio.underfs.hdfs.HdfsPositionedUnderFileInputStream
-
- All Implemented Interfaces:
alluxio.Positioned,alluxio.PositionReader,alluxio.Seekable,java.io.Closeable,java.lang.AutoCloseable
public class HdfsPositionedUnderFileInputStream extends alluxio.underfs.SeekableUnderFileInputStream implements alluxio.PositionReaderThe input stream of HDFS as under filesystem. This input stream has two mode of operations. Under sequential mode, it uses the read api and can take advantage of underlying stream's buffering. Under random read mode, it uses the positionedReadFSDataInputStreamAPI. This stream can be cached for reuse.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()longgetPos()booleanmarkSupported()intread()intread(byte[] b)intread(byte[] buffer, int offset, int length)If there has been a number of sequential reads in a row, we move to regular buffered reads.intreadInternal(long position, alluxio.file.ReadTargetBuffer buffer, int length)voidseek(long position)longskip(long n)-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Method Detail
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.FilterInputStream- Throws:
java.io.IOException
-
getPos
public long getPos()
- Specified by:
getPosin interfacealluxio.Positioned
-
read
public int read()
- Overrides:
readin classjava.io.FilterInputStream
-
read
public int read(byte[] b)
- Overrides:
readin classjava.io.FilterInputStream
-
read
public int read(byte[] buffer, int offset, int length)If there has been a number of sequential reads in a row, we move to regular buffered reads.- Overrides:
readin classjava.io.FilterInputStream
-
seek
public void seek(long position)
- Specified by:
seekin interfacealluxio.Seekable
-
skip
public long skip(long n)
- Overrides:
skipin classjava.io.FilterInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.FilterInputStream
-
readInternal
public int readInternal(long position, alluxio.file.ReadTargetBuffer buffer, int length) throws java.io.IOException- Specified by:
readInternalin interfacealluxio.PositionReader- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacealluxio.PositionReader- Overrides:
closein classjava.io.FilterInputStream- Throws:
java.io.IOException
-
-