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
FieldsModifier and TypeFieldDescriptionprotected BufferAllocatorprotected booleanprotected final booleanprotected final longThe offset in the underlying stream to start reading fromprotected Stringprotected final longThe length of the data we expect to read.Fields inherited from class java.io.FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionDirectBufInputStream(InputStream in, BufferAllocator allocator, String id, long startOffset, long totalByteSize, boolean enforceTotalByteSize, boolean enableHints) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidvoidclose()protected static voidfadviseIfAvailable(org.apache.hadoop.fs.FSDataInputStream inputStream, long off, long n) protected org.apache.hadoop.fs.FSDataInputStreamgetNext(int bytes) longgetPos()booleanvoidinit()intread()intMethods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, read, reset, skipMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
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:
readin classFilterInputStream- Throws:
IOException
-
read
- Throws:
IOException
-
getNext
- Throws:
IOException
-
getPos
- Throws:
IOException
-
hasRemainder
- Throws:
IOException
-
getInputStream
- Throws:
IOException
-
checkInputStreamState
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream- Throws:
IOException
-
checkStreamSupportsByteBuffer
- Throws:
UnsupportedOperationException
-
fadviseIfAvailable
protected static void fadviseIfAvailable(org.apache.hadoop.fs.FSDataInputStream inputStream, long off, long n)
-