Class DetectNewPartitionsRangeTracker
- java.lang.Object
-
- org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker<TimestampRange,com.google.cloud.Timestamp>
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.restriction.TimestampRangeTracker
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.restriction.DetectNewPartitionsRangeTracker
-
- All Implemented Interfaces:
org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker.HasProgress
public class DetectNewPartitionsRangeTracker extends TimestampRangeTracker
This restriction tracker delegates most of its behavior to an internalTimestampRangeTracker
. It has a different logic for tryClaim method. It ignores claims for the same timestamp multiple times.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker
org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker.HasProgress, org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker.IsBounded, org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker.Progress, org.apache.beam.sdk.transforms.splittabledofn.RestrictionTracker.TruncateResult<RestrictionT extends java.lang.Object>
-
-
Field Summary
-
Fields inherited from class org.apache.beam.sdk.io.gcp.spanner.changestreams.restriction.TimestampRangeTracker
lastAttemptedPosition, lastClaimedPosition, range, timeSupplier
-
-
Constructor Summary
Constructors Constructor Description DetectNewPartitionsRangeTracker(TimestampRange range)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
tryClaim(com.google.cloud.Timestamp position)
Attempts to claim the given position.-
Methods inherited from class org.apache.beam.sdk.io.gcp.spanner.changestreams.restriction.TimestampRangeTracker
checkDone, currentRestriction, getProgress, isBounded, setTimeSupplier, trySplit
-
-
-
-
Constructor Detail
-
DetectNewPartitionsRangeTracker
public DetectNewPartitionsRangeTracker(TimestampRange range)
-
-
Method Detail
-
tryClaim
public boolean tryClaim(com.google.cloud.Timestamp position)
Attempts to claim the given position.Must be equal or larger than the last successfully claimed position.
- Overrides:
tryClaim
in classTimestampRangeTracker
- Returns:
true
if the position was successfully claimed,false
if it is outside the currentTimestampRange
of this tracker (in that case this operation is a no-op).
-
-