Class DirectBufInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.drill.exec.util.filereader.DirectBufInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
BufferedDirectBufInputStream
-
Field Summary
Modifier and TypeFieldDescriptionprotected BufferAllocator
protected boolean
protected final boolean
protected final long
The offset in the underlying stream to start reading fromprotected String
protected final long
The length of the data we expect to read.Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorDescriptionDirectBufInputStream
(InputStream in, BufferAllocator allocator, String id, long startOffset, long totalByteSize, boolean enforceTotalByteSize, boolean enableHints) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
void
close()
protected static void
fadviseIfAvailable
(org.apache.hadoop.fs.FSDataInputStream inputStream, long off, long n) protected org.apache.hadoop.fs.FSDataInputStream
getNext
(int bytes) long
getPos()
boolean
void
init()
int
read()
int
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, read, reset, skip
-
Field Details
-
enableHints
protected boolean enableHints -
streamId
-
allocator
-
totalByteSize
protected final long totalByteSizeThe length of the data we expect to read. The caller may, in fact, ask for more or less bytes. However this is useful for providing hints where the underlying InputStream supports hints (e.g. fadvise) -
enforceTotalByteSize
protected final boolean enforceTotalByteSize -
startOffset
protected final long startOffsetThe offset in the underlying stream to start reading from
-
-
Constructor Details
-
DirectBufInputStream
public DirectBufInputStream(InputStream in, BufferAllocator allocator, String id, long startOffset, long totalByteSize, boolean enforceTotalByteSize, boolean enableHints)
-
-
Method Details
-
init
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Throws:
IOException
-
getNext
- Throws:
IOException
-
getPos
- Throws:
IOException
-
hasRemainder
- Throws:
IOException
-
getInputStream
- Throws:
IOException
-
checkInputStreamState
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
-
checkStreamSupportsByteBuffer
- Throws:
UnsupportedOperationException
-
fadviseIfAvailable
protected static void fadviseIfAvailable(org.apache.hadoop.fs.FSDataInputStream inputStream, long off, long n)
-