Class UniqueIdGenerator
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.bigtable.changestreams.UniqueIdGenerator
-
@Internal public class UniqueIdGenerator extends java.lang.ObjectGenerate unique IDs that can be used to differentiate different jobs and partitions.
-
-
Constructor Summary
Constructors Constructor Description UniqueIdGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgenerateRowKeyPrefix()Return a random base64 encoded 8 byte string.static java.lang.StringgetNextId()Return a random base64 encoded 8 byte string.
-
-
-
Method Detail
-
getNextId
public static java.lang.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 <10 values per partition is less than 1 in 10^18.- Returns:
- a random 8 byte string.
-
generateRowKeyPrefix
public static java.lang.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.
-
-