Package org.apache.flink.orc
Class OrcSplitReader<T,BATCH>
- java.lang.Object
-
- org.apache.flink.orc.OrcSplitReader<T,BATCH>
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
OrcColumnarRowSplitReader
public abstract class OrcSplitReader<T,BATCH> extends Object implements Closeable
Orc split reader to read record from orc file. The reader is only responsible for reading the data of a single split.
-
-
Field Summary
Fields Modifier and Type Field Description protected intnextRowprotected OrcVectorizedBatchWrapper<BATCH>rowBatchWrapper
-
Constructor Summary
Constructors Constructor Description OrcSplitReader(OrcShim<BATCH> shim, org.apache.hadoop.conf.Configuration conf, org.apache.orc.TypeDescription schema, int[] selectedFields, List<OrcFilters.Predicate> conjunctPredicates, int batchSize, org.apache.flink.core.fs.Path path, long splitStart, long splitLength)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected abstract intfillRows()Fills an ORC batch into an array of Row.org.apache.orc.RecordReadergetRecordReader()abstract TnextRecord(T reuse)Reads the next record from the input.booleanreachedEnd()Method used to check if the end of the input is reached.voidseekToRow(long rowCount)Seek to a particular row number.
-
-
-
Field Detail
-
rowBatchWrapper
protected final OrcVectorizedBatchWrapper<BATCH> rowBatchWrapper
-
nextRow
protected int nextRow
-
-
Constructor Detail
-
OrcSplitReader
public OrcSplitReader(OrcShim<BATCH> shim, org.apache.hadoop.conf.Configuration conf, org.apache.orc.TypeDescription schema, int[] selectedFields, List<OrcFilters.Predicate> conjunctPredicates, int batchSize, org.apache.flink.core.fs.Path path, long splitStart, long splitLength) throws IOException
- Throws:
IOException
-
-
Method Detail
-
seekToRow
public void seekToRow(long rowCount) throws IOExceptionSeek to a particular row number.- Throws:
IOException
-
getRecordReader
@VisibleForTesting public org.apache.orc.RecordReader getRecordReader()
-
reachedEnd
public boolean reachedEnd() throws IOExceptionMethod used to check if the end of the input is reached.- Returns:
- True if the end is reached, otherwise false.
- Throws:
IOException- Thrown, if an I/O error occurred.
-
fillRows
protected abstract int fillRows()
Fills an ORC batch into an array of Row.- Returns:
- The number of rows that were filled.
-
nextRecord
public abstract T nextRecord(T reuse) throws IOException
Reads the next record from the input.- Parameters:
reuse- Object that may be reused.- Returns:
- Read record.
- Throws:
IOException- Thrown, if an I/O error occurred.
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-