Class ChangeStreamContinuationTokenHelper

java.lang.Object
org.apache.beam.sdk.io.gcp.bigtable.changestreams.ChangeStreamContinuationTokenHelper

public class ChangeStreamContinuationTokenHelper extends Object
  • Constructor Details

    • ChangeStreamContinuationTokenHelper

      public ChangeStreamContinuationTokenHelper()
  • Method Details

    • getTokenWithCorrectPartition

      public static ChangeStreamContinuationToken getTokenWithCorrectPartition(Range.ByteStringRange parentPartition, ChangeStreamContinuationToken token) throws IllegalArgumentException
      Return the continuation token with correct partition. The partition in the ChangeStreamContinuationToken for merges is not the correct partition (this is a backend bug that is being fixed). The partition currently represents the child partition, where the current partition should merge to.

      For example: Partition [A, B) gets CloseStream to merge into [A, C). The ChangeStreamContinuationToken returned is { partition = [A, C), token = "token1" } . However, the correct ChangeStreamContinuationToken should be { partition = [A, B), token = "token1" }.

      Parameters:
      parentPartition - parent partition where the ChangeStreamContinuationToken is generated
      token - ChangeStreamContinuationToken to be fixed
      Returns:
      ChangeStreamContinuationToken with correct partition field
      Throws:
      IllegalArgumentException