Interface BulkFormat.Reader<T>
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
AbstractOrcFileInputFormat.OrcVectorizedReader
,StreamFormatAdapter.Reader
- Enclosing interface:
- BulkFormat<T,SplitT extends FileSourceSplit>
public static interface BulkFormat.Reader<T> extends Closeable
The actual reader that reads the batches of records.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes the reader and should release all resources.BulkFormat.RecordIterator<T>
readBatch()
Reads one batch.
-
-
-
Method Detail
-
readBatch
@Nullable BulkFormat.RecordIterator<T> readBatch() throws IOException
Reads one batch. The method should return null when reaching the end of the input. The returned batch will be handed over to the processing threads as one.The returned iterator object and any contained objects may be held onto by the file source for some time, so it should not be immediately reused by the reader.
To implement reuse and to save object allocation, consider using a
Pool
and recycle objects into the Pool in the theBulkFormat.RecordIterator.releaseBatch()
method.- Throws:
IOException
-
close
void close() throws IOException
Closes the reader and should release all resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-