Class RecordAndPosition<T>


  • @Internal
    public class RecordAndPosition<T>
    extends java.lang.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.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int fileOffset()  
      T record()  
      void record​(T nextRecord)
      Sets the next record of a sequence.
      long recordOffset()  
      void set​(T newRecord, int newFileOffset, long newRecordOffset)
      Updates the record and position in this object.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RecordAndPosition

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

        public RecordAndPosition()
    • Method Detail

      • 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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object