@DefaultCoder(value=AvroCoder.class) public class KafkaCheckpointMark extends java.lang.Object implements UnboundedSource.CheckpointMark
KafkaUnboundedReader
. Consists of Kafka topic name, partition id, and
the latest offset consumed so far.Modifier and Type | Class and Description |
---|---|
static class |
KafkaCheckpointMark.PartitionMark
A tuple to hold topic, partition, and offset that comprise the checkpoint for a single
partition.
|
UnboundedSource.CheckpointMark.NoopCheckpointMark
NOOP_CHECKPOINT_MARK
Constructor and Description |
---|
KafkaCheckpointMark(java.util.List<KafkaCheckpointMark.PartitionMark> partitions,
java.util.Optional<org.apache.beam.sdk.io.kafka.KafkaUnboundedReader<?,?>> reader) |
Modifier and Type | Method and Description |
---|---|
void |
finalizeCheckpoint()
Called by the system to signal that this checkpoint mark has been committed along with all
the records which have been read from the
UnboundedSource.UnboundedReader since the previous
checkpoint was taken. |
java.util.List<KafkaCheckpointMark.PartitionMark> |
getPartitions() |
java.lang.String |
toString() |
public KafkaCheckpointMark(java.util.List<KafkaCheckpointMark.PartitionMark> partitions, java.util.Optional<org.apache.beam.sdk.io.kafka.KafkaUnboundedReader<?,?>> reader)
public java.util.List<KafkaCheckpointMark.PartitionMark> getPartitions()
public void finalizeCheckpoint()
UnboundedSource.CheckpointMark
UnboundedSource.UnboundedReader
since the previous
checkpoint was taken.
For example, this method could send acknowledgements to an external data source such as Pubsub.
Note that:
UnboundedSource.UnboundedReader
it was created from.
UnboundedSource.UnboundedReader
has not
yet be finalized.
UnboundedSource.UnboundedReader
.
UnboundedSource.UnboundedReader
from which this checkpoint was
created still exists at the time this method is called.
finalizeCheckpoint
in interface UnboundedSource.CheckpointMark
public java.lang.String toString()
toString
in class java.lang.Object