@PublicEvolving public final class CheckpointedPosition extends Object implements Serializable
NO_OFFSET
, in which case only the records-to-skip count is used.
The combination of offset and records-to-skip makes it possible to represent the position of a wide variety of readers. In the simplest case, readers might store no offset and only store how many records they previously returned. On the other hand, readers that can precisely point to each record via a position can store that in the checkpoint. Readers that have occasional addressable positions (like sync markers, block starts, etc.) can store those together with the records skipped after the last marker.
Modifier and Type | Field and Description |
---|---|
static long |
NO_OFFSET
Constant for the offset, reflecting that the position does not contain any offset
information.
|
Constructor and Description |
---|
CheckpointedPosition(long offset,
long recordsAfterOffset)
Creates a new CheckpointedPosition for given offset and records-to-skip.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
long |
getOffset()
Gets the offset that the reader will seek to when restored from this checkpoint.
|
long |
getRecordsAfterOffset()
Gets the records to skip after the offset.
|
int |
hashCode() |
String |
toString() |
public static final long NO_OFFSET
public CheckpointedPosition(long offset, long recordsAfterOffset)
offset
- The offset that the reader will seek to when restored from this checkpoint.recordsAfterOffset
- The records to skip after the offset.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.