Class UniqueIdGenerator

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

@Internal public class UniqueIdGenerator extends Object
Generate unique IDs that can be used to differentiate different jobs and partitions.
  • Constructor Details

    • UniqueIdGenerator

      public UniqueIdGenerator()
  • Method Details

    • getNextId

      public static String getNextId()
      Return a random base64 encoded 8 byte string. This is used to identify streamer of a specific partition. We expect there to be at most single digit duplicates of the same partition at any one time. The odd of collision if we generate invalid input: '<'10 values per partition is less than 1 in 10^18.
      Returns:
      a random 8 byte string.
    • generateRowKeyPrefix

      public static String generateRowKeyPrefix()
      Return a random base64 encoded 8 byte string. This is used to identify a pipeline. Once a pipeline is complete, the metadata is left there and not cleaned up. It's possible, over the lifetime, there to be thousands and more pipelines in a single metadata table. The odds of collision if we expect 100,000 pipelines is less than 1 in 1 billion.
      Returns:
      a random 8 byte string.