@Internal
public class ReadChangeStreamPartitionAction
extends java.lang.Object
ReadChangeStreamPartitionDoFn SDF.| Constructor and Description |
|---|
ReadChangeStreamPartitionAction(MetadataTableDao metadataTableDao,
ChangeStreamDao changeStreamDao,
ChangeStreamMetrics metrics,
ChangeStreamAction changeStreamAction,
org.joda.time.Duration heartbeatDuration) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.beam.sdk.transforms.DoFn.ProcessContinuation |
run(PartitionRecord partitionRecord,
org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker<StreamProgress,StreamProgress> tracker,
org.apache.beam.sdk.transforms.DoFn.OutputReceiver<org.apache.beam.sdk.values.KV<com.google.protobuf.ByteString,com.google.cloud.bigtable.data.v2.models.ChangeStreamMutation>> receiver,
org.apache.beam.sdk.transforms.splittabledofn.ManualWatermarkEstimator<org.joda.time.Instant> watermarkEstimator)
Streams changes from a specific partition.
|
public ReadChangeStreamPartitionAction(MetadataTableDao metadataTableDao, ChangeStreamDao changeStreamDao, ChangeStreamMetrics metrics, ChangeStreamAction changeStreamAction, org.joda.time.Duration heartbeatDuration)
public org.apache.beam.sdk.transforms.DoFn.ProcessContinuation run(PartitionRecord partitionRecord, org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker<StreamProgress,StreamProgress> tracker, org.apache.beam.sdk.transforms.DoFn.OutputReceiver<org.apache.beam.sdk.values.KV<com.google.protobuf.ByteString,com.google.cloud.bigtable.data.v2.models.ChangeStreamMutation>> receiver, org.apache.beam.sdk.transforms.splittabledofn.ManualWatermarkEstimator<org.joda.time.Instant> watermarkEstimator) throws java.io.IOException
ChangeStreamAction to process
individual response from the change stream.
Before we send a request to Cloud Bigtable to stream the partition, we need to perform a few things.
DetectNewPartitionsDoFn can read and output those new partitions to be streamed. We also
need to ensure we clean up this partition's metadata to release the lock.
partitionRecord - partition information used to identify this streamtracker - restriction tracker of ReadChangeStreamPartitionDoFnreceiver - output receiver for ReadChangeStreamPartitionDoFnwatermarkEstimator - watermark estimator ReadChangeStreamPartitionDoFnDoFn.ProcessContinuation.stop() if a checkpoint is required or the stream has
completed. Or DoFn.ProcessContinuation.resume() if a checkpoint is required.java.io.IOException - when stream fails.