Class RecordAndPosition<T>
- java.lang.Object
-
- org.apache.iceberg.flink.source.reader.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.
-
-
Constructor Summary
Constructors Constructor Description RecordAndPosition()
RecordAndPosition(T record, int fileOffset, long recordOffset)
-
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()
-
-
-
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 therecordOffset
by one.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-