问题
I have a streaming pipeline developed in Apache Beam (using Spark Runner) which reads from kinesis stream.
I am looking out for options in Apache Beam to manage kinesis checkpointing (i.e. stores periodically the current position of kinesis stream) so as it allows the system to recover from failures and continue processing where the stream left off.
Is there a provision available for Apache Beam to support kinesis checkpointing as similar to Spark Streaming (Reference link - https://spark.apache.org/docs/2.2.0/streaming-kinesis-integration.html)?
回答1:
Since KinesisIO
is based on UnboundedSource.CheckpointMark
, it uses the standard checkpoint mechanism, provided by Beam UnboundedSource.UnboundedReader
.
Once a KinesisRecord
has been read (actually, pulled from a records queue that is feed separately by actually fetching the records from Kinesis shard), then the shard checkpoint will be updated by using the record SequenceNumber
and then, depending on runner implementation of UnboundedSource
and checkpoints processing, will be saved.
Afaik, Beam Spark Runner uses Spark States mechanism for this purposes.
来源:https://stackoverflow.com/questions/62259364/how-apache-beam-manage-kinesis-checkpointing