Class ReadChangeStreamPartitionDoFn
java.lang.Object
org.apache.beam.sdk.transforms.DoFn<PartitionRecord,KV<ByteString,com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord>>
org.apache.beam.sdk.io.gcp.bigtable.changestreams.dofn.ReadChangeStreamPartitionDoFn
- All Implemented Interfaces:
Serializable
,HasDisplayData
@Internal
@UnboundedPerElement
public class ReadChangeStreamPartitionDoFn
extends DoFn<PartitionRecord,KV<ByteString,com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord>>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.transforms.DoFn
DoFn.AlwaysFetched, DoFn.BoundedPerElement, DoFn.BundleFinalizer, DoFn.Element, DoFn.FieldAccess, DoFn.FinishBundle, DoFn.FinishBundleContext, DoFn.GetInitialRestriction, DoFn.GetInitialWatermarkEstimatorState, DoFn.GetRestrictionCoder, DoFn.GetSize, DoFn.GetWatermarkEstimatorStateCoder, DoFn.Key, DoFn.MultiOutputReceiver, DoFn.NewTracker, DoFn.NewWatermarkEstimator, DoFn.OnTimer, DoFn.OnTimerContext, DoFn.OnTimerFamily, DoFn.OnWindowExpiration, DoFn.OnWindowExpirationContext, DoFn.OutputReceiver<T>, DoFn.ProcessContext, DoFn.ProcessContinuation, DoFn.ProcessElement, DoFn.RequiresStableInput, DoFn.RequiresTimeSortedInput, DoFn.Restriction, DoFn.Setup, DoFn.SideInput, DoFn.SplitRestriction, DoFn.StartBundle, DoFn.StartBundleContext, DoFn.StateId, DoFn.Teardown, DoFn.TimerFamily, DoFn.TimerId, DoFn.Timestamp, DoFn.TruncateRestriction, DoFn.UnboundedPerElement, DoFn.WatermarkEstimatorState, DoFn.WindowedContext
-
Constructor Summary
ConstructorsConstructorDescriptionReadChangeStreamPartitionDoFn
(DaoFactory daoFactory, ActionFactory actionFactory, ChangeStreamMetrics metrics, Duration backlogReplicationAdjustment) -
Method Summary
Modifier and TypeMethodDescriptiongetInitialWatermarkEstimatorState
(PartitionRecord partitionRecord) double
getSize
(StreamProgress streamProgress) newWatermarkEstimator
(Instant watermarkEstimatorState) processElement
(PartitionRecord partitionRecord, RestrictionTracker<StreamProgress, StreamProgress> tracker, DoFn.OutputReceiver<KV<ByteString, com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord>> receiver, ManualWatermarkEstimator<Instant> watermarkEstimator) restrictionTracker
(StreamProgress restriction) void
setSizeEstimator
(CoderSizeEstimator<KV<ByteString, com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord>> sizeEstimator) Sets the estimator to track throughput for each DoFn instance.void
setup()
Methods inherited from class org.apache.beam.sdk.transforms.DoFn
getAllowedTimestampSkew, getInputTypeDescriptor, getOutputTypeDescriptor, populateDisplayData, prepareForProcessing
-
Constructor Details
-
ReadChangeStreamPartitionDoFn
public ReadChangeStreamPartitionDoFn(DaoFactory daoFactory, ActionFactory actionFactory, ChangeStreamMetrics metrics, Duration backlogReplicationAdjustment)
-
-
Method Details
-
getInitialWatermarkEstimatorState
@GetInitialWatermarkEstimatorState public Instant getInitialWatermarkEstimatorState(@Element PartitionRecord partitionRecord) -
newWatermarkEstimator
@NewWatermarkEstimator public ManualWatermarkEstimator<Instant> newWatermarkEstimator(@WatermarkEstimatorState Instant watermarkEstimatorState) -
initialRestriction
-
restrictionTracker
@NewTracker public ReadChangeStreamPartitionProgressTracker restrictionTracker(@Restriction StreamProgress restriction) -
getSize
-
setup
- Throws:
IOException
-
processElement
@ProcessElement public DoFn.ProcessContinuation processElement(@Element PartitionRecord partitionRecord, RestrictionTracker<StreamProgress, StreamProgress> tracker, DoFn.OutputReceiver<KV<ByteString, throws InterruptedException, IOExceptioncom.google.cloud.bigtable.data.v2.models.ChangeStreamRecord>> receiver, ManualWatermarkEstimator<Instant> watermarkEstimator) - Throws:
InterruptedException
IOException
-
setSizeEstimator
public void setSizeEstimator(CoderSizeEstimator<KV<ByteString, com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord>> sizeEstimator) Sets the estimator to track throughput for each DoFn instance.- Parameters:
sizeEstimator
- an estimator to calculate the size of records for throughput estimates
-