Class HeartbeatRecordAction
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.action.HeartbeatRecordAction
-
public class HeartbeatRecordAction extends java.lang.Object
This class is part of the process forReadChangeStreamPartitionDoFn
SDF. It is responsible for processingHeartbeatRecord
s. The records will be used to progress the watermark for the current element (partition).
-
-
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, HeartbeatRecord record, org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker<TimestampRange,com.google.cloud.Timestamp> tracker, org.apache.beam.sdk.transforms.splittabledofn.ManualWatermarkEstimator<org.joda.time.Instant> watermarkEstimator)
This is the main processing function for aHeartbeatRecord
.
-
-
-
Method Detail
-
run
public java.util.Optional<org.apache.beam.sdk.transforms.DoFn.ProcessContinuation> run(PartitionMetadata partition, HeartbeatRecord record, org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker<TimestampRange,com.google.cloud.Timestamp> tracker, org.apache.beam.sdk.transforms.splittabledofn.ManualWatermarkEstimator<org.joda.time.Instant> watermarkEstimator)
This is the main processing function for aHeartbeatRecord
. 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 theHeartbeatRecord
, so the caller should stop.When processing the
HeartbeatRecord
the following procedure is applied:- We try to claim the heartbeat record timestamp. If it is not possible, we stop here and return.
- We update the necessary metrics.
- We update the watermark to the heartbeat record timestamp.
-
-