Interface StreamFormat.Reader<T>
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
TextLineInputFormat.Reader
- Enclosing interface:
- StreamFormat<T>
@PublicEvolving public static interface StreamFormat.Reader<T> extends Closeable
The actual reader that reads the records.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()Closes the reader to release all resources.default CheckpointedPositiongetCheckpointedPosition()Optionally returns the current position of the reader.Tread()Reads the next record.
-
-
-
Method Detail
-
read
@Nullable T read() throws IOException
Reads the next record. Returnsnullwhen the input has reached its end.- Throws:
IOException
-
close
void close() throws IOExceptionCloses the reader to release all resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getCheckpointedPosition
@Nullable default CheckpointedPosition getCheckpointedPosition()
Optionally returns the current position of the reader. This can be implemented by readers that want to speed up recovery from a checkpoint.The current position of the reader is the position of the next record that will be returned in a call to
read(). This can be implemented by readers that want to speed up recovery from a checkpoint.See the
top-level class comment(section "Checkpointing") for details.
-
-