@Internal
public class RecordAndPosition<T>
extends java.lang.Object
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 and Description |
---|
RecordAndPosition() |
RecordAndPosition(T record,
int fileOffset,
long recordOffset) |
Modifier and Type | Method and 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() |
public RecordAndPosition(T record, int fileOffset, long recordOffset)
public RecordAndPosition()
public T record()
public int fileOffset()
public long recordOffset()
public void set(T newRecord, int newFileOffset, long newRecordOffset)
public void record(T nextRecord)
recordOffset
by one.public java.lang.String toString()
toString
in class java.lang.Object