Class PartitionStartRecordAction
java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.changestreams.action.PartitionStartRecordAction
This class is part of the process for invalid input: '{@link
org.apache.beam.sdk.io.gcp.spanner.changestreams.dofn..ReadChangeStreamPartitionDoFn'} SDF. It is
responsible for processing
SDF.
PartitionStartRecords. The new partition start records will be
stored in the Connector's metadata tables in order to be scheduled for future querying by the
invalid reference
org.apache.beam.sdk.io.gcp.spanner.changestreams.dofn.dofn.DetectNewPartitionsDoFn
-
Method Summary
Modifier and TypeMethodDescriptionrun(PartitionMetadata partition, PartitionStartRecord record, RestrictionTracker<TimestampRange, com.google.cloud.Timestamp> tracker, RestrictionInterrupter<com.google.cloud.Timestamp> interrupter, ManualWatermarkEstimator<Instant> watermarkEstimator) This is the main processing function for aPartitionStartRecord.
-
Method Details
-
run
public Optional<DoFn.ProcessContinuation> run(PartitionMetadata partition, PartitionStartRecord record, RestrictionTracker<TimestampRange, com.google.cloud.Timestamp> tracker, RestrictionInterrupter<com.google.cloud.Timestamp> interrupter, ManualWatermarkEstimator<Instant> watermarkEstimator) This is the main processing function for aPartitionStartRecord. 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 thePartitionStartRecord, so the caller should stop.When processing the
PartitionStartRecordthe following procedure is applied:- We try to claim the partition start record timestamp. If it is not possible, we stop here and return.
- We update the watermark to the partition start record timestamp.
- For each partition start record, we try to insert them in the metadata tables if they do not exist.
- For each partition start record, we increment the corresponding metric.
- Parameters:
partition- the current partition being processedrecord- the change stream partition start record receivedtracker- the restriction tracker of theSDFinvalid reference
com.google.cloud.teleport.spanner.spannerio.changestreams.dofn.ReadChangeStreamPartitionDoFninterrupter- the restriction interrupter suggesting early termination of the processingwatermarkEstimator- the watermark estimator of theSDFinvalid reference
com.google.cloud.teleport.spanner.spannerio.changestreams.dofn.ReadChangeStreamPartitionDoFn- Returns:
Optional.empty()if the caller can continue processing more records. A non emptyOptionalwithDoFn.ProcessContinuation.stop()if this function was unable to claim thetimestamp. A non emptyinvalid reference
ChildPartitionsRecordOptionalwithDoFn.ProcessContinuation.resume()if this function should commit what has already been processed and resume.
-