Class RecordAndPosition<T>

java.lang.Object
org.apache.iceberg.flink.source.reader.RecordAndPosition<T>

@Internal public class RecordAndPosition<T> extends Object
A record along with the reader position to be stored in the checkpoint.

The position defines the point in the reader AFTER the record. Record processing and updating checkpointed state happens atomically. The position points to where the reader should resume after this record is processed.

This mutable object is useful in cases where only one instance of a RecordAndPosition is needed at a time. Then the same instance of RecordAndPosition can be reused.

  • Constructor Details

    • RecordAndPosition

      public RecordAndPosition(T record, int fileOffset, long recordOffset)
    • RecordAndPosition

      public RecordAndPosition()
  • Method Details

    • record

      public T record()
    • fileOffset

      public int fileOffset()
    • recordOffset

      public long recordOffset()
    • set

      public void set(T newRecord, int newFileOffset, long newRecordOffset)
      Updates the record and position in this object.
    • record

      public void record(T nextRecord)
      Sets the next record of a sequence. This increments the recordOffset by one.
    • toString

      public String toString()
      Overrides:
      toString in class Object