Class PartitionEventRecordAction
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.action.PartitionEventRecordAction
-
public class PartitionEventRecordAction extends java.lang.ObjectThis class is part of the process forReadChangeStreamPartitionDoFnSDF. It is responsible for processingPartitionEventRecords. The records will be used to progress the watermark for the current element (partition). Note that because of the returned list of data change record by the connector is not ordered, so the MoveInEvent, MoveOutEvent are not processed by the connector.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<org.apache.beam.sdk.transforms.DoFn.ProcessContinuation>run(PartitionMetadata partition, PartitionEventRecord record, org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker<TimestampRange,com.google.cloud.Timestamp> tracker, RestrictionInterrupter<com.google.cloud.Timestamp> interrupter, org.apache.beam.sdk.transforms.splittabledofn.ManualWatermarkEstimator<org.joda.time.Instant> watermarkEstimator)This is the main processing function for aPartitionEventRecord.
-
-
-
Method Detail
-
run
public java.util.Optional<org.apache.beam.sdk.transforms.DoFn.ProcessContinuation> run(PartitionMetadata partition, PartitionEventRecord record, org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker<TimestampRange,com.google.cloud.Timestamp> tracker, RestrictionInterrupter<com.google.cloud.Timestamp> interrupter, org.apache.beam.sdk.transforms.splittabledofn.ManualWatermarkEstimator<org.joda.time.Instant> watermarkEstimator)
This is the main processing function for aPartitionEventRecord. It returns anOptionalofDoFn.ProcessContinuationto indicate if the calling function should stop or not. If theOptionalreturned is empty, it means that the calling function can continue with the processing. If anOptionalofDoFn.ProcessContinuation.stop()is returned, it means that this function was unable to claim the timestamp of thePartitionEventRecord, so the caller should stop. If anOptionalofDoFn.ProcessContinuation.resume()is returned, it means that this function should not attempt to claim further timestamps of thePartitionEventRecord, but instead should commit what it has processed so far.When processing the
PartitionEventRecordthe 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.
-
-