Class PartitionEndRecordAction
java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.changestreams.action.PartitionEndRecordAction
This class is part of the process for
ReadChangeStreamPartitionDoFn
SDF. It is
responsible for processing PartitionEndRecord
s. The records will be used to progress the
watermark for the current element (partition). Note that once after this record, the partition
will not generate any incomming change records. As the result, the QueryChangeStreamAction will
mark the partition reading as finished by itself.-
Method Summary
Modifier and TypeMethodDescriptionrun
(PartitionMetadata partition, PartitionEndRecord record, RestrictionTracker<TimestampRange, com.google.cloud.Timestamp> tracker, RestrictionInterrupter<com.google.cloud.Timestamp> interrupter, ManualWatermarkEstimator<Instant> watermarkEstimator) This is the main processing function for aPartitionEndRecord
.
-
Method Details
-
run
public Optional<DoFn.ProcessContinuation> run(PartitionMetadata partition, PartitionEndRecord record, RestrictionTracker<TimestampRange, com.google.cloud.Timestamp> tracker, RestrictionInterrupter<com.google.cloud.Timestamp> interrupter, ManualWatermarkEstimator<Instant> watermarkEstimator) This is the main processing function for aPartitionEndRecord
. It returns anOptional
ofDoFn.ProcessContinuation
to indicate if the calling function should stop or not. If theOptional
returned is empty, it means that the calling function can continue with the processing. If anOptional
ofDoFn.ProcessContinuation.stop()
is returned, it means that this function was unable to claim the timestamp of thePartitionEndRecord
, so the caller should stop. If anOptional
ofDoFn.ProcessContinuation.resume()
is returned, it means that this function should not attempt to claim further timestamps of thePartitionEndRecord
, but instead should commit what it has processed so far.When processing the
PartitionEndRecord
the following procedure is applied:- We try to claim the partition end record timestamp. If it is not possible, we stop here and return.
- We update the necessary metrics.
- We update the watermark to the partition end record timestamp.
-