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 void
close()
Closes the reader to release all resources.default CheckpointedPosition
getCheckpointedPosition()
Optionally returns the current position of the reader.T
read()
Reads the next record.
-
-
-
Method Detail
-
read
@Nullable T read() throws IOException
Reads the next record. Returnsnull
when the input has reached its end.- Throws:
IOException
-
close
void close() throws IOException
Closes the reader to release all resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in 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.
-
-