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

    Modifier and Type
    Method
    Description
    void
    Closes the reader to release all resources.
    Optionally returns the current position of the reader.
    Reads the next record.
  • Method Details

    • read

      @Nullable T read() throws IOException
      Reads the next record. Returns null 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 interface AutoCloseable
      Specified by:
      close in interface Closeable
      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.