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:
RestrictionTracker.HasProgress

public class DetectNewPartitionsRangeTracker extends TimestampRangeTracker
This restriction tracker delegates most of its behavior to an internal TimestampRangeTracker. It has a different logic for tryClaim method. It ignores claims for the same timestamp multiple times.
  • Constructor Details

    • DetectNewPartitionsRangeTracker

      public DetectNewPartitionsRangeTracker(TimestampRange range)
  • Method Details

    • 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 class TimestampRangeTracker
      Returns:
      true if the position was successfully claimed, false if it is outside the current TimestampRange of this tracker (in that case this operation is a no-op).