Class StreamFormatAdapter.Reader<T>
- java.lang.Object
-
- org.apache.flink.connector.file.src.impl.StreamFormatAdapter.Reader<T>
-
- All Implemented Interfaces:
Closeable,AutoCloseable,BulkFormat.Reader<T>
- Enclosing class:
- StreamFormatAdapter<T>
public static final class StreamFormatAdapter.Reader<T> extends Object implements BulkFormat.Reader<T>
The reader adapter, fromStreamFormat.ReadertoBulkFormat.Reader.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the reader and should release all resources.BulkFormat.RecordIterator<T>readBatch()Reads one batch.
-
-
-
Method Detail
-
readBatch
@Nullable public BulkFormat.RecordIterator<T> readBatch() throws IOException
Description copied from interface:BulkFormat.ReaderReads 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
Pooland recycle objects into the Pool in the theBulkFormat.RecordIterator.releaseBatch()method.- Specified by:
readBatchin interfaceBulkFormat.Reader<T>- Throws:
IOException
-
close
public void close() throws IOExceptionDescription copied from interface:BulkFormat.ReaderCloses the reader and should release all resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBulkFormat.Reader<T>- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-