Class PartitionMetadataTableNames
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.dao.PartitionMetadataTableNames
-
- All Implemented Interfaces:
java.io.Serializable
public class PartitionMetadataTableNames extends java.lang.Object implements java.io.SerializableConfiguration for a partition metadata table. It encapsulates the name of the metadata table and indexes.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PartitionMetadataTableNames(java.lang.String tableName, java.lang.String watermarkIndexName, java.lang.String createdAtIndexName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)static PartitionMetadataTableNamesfromExistingTable(java.lang.String databaseId, java.lang.String table)Encapsulates a selected table name.static PartitionMetadataTableNamesgenerateRandom(java.lang.String databaseId)Generates a unique name for the partition metadata table and its indexes.java.lang.StringgetCreatedAtIndexName()java.lang.StringgetTableName()java.lang.StringgetWatermarkIndexName()inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
generateRandom
public static PartitionMetadataTableNames generateRandom(java.lang.String databaseId)
Generates a unique name for the partition metadata table and its indexes. The table name will be in the form of"Metadata_<databaseId>_<uuid>". The watermark index will be in the form of"WatermarkIdx_<databaseId>_<uuid>. The createdAt / start timestamp index will be in the form of"CreatedAtIdx_<databaseId>_<uuid>.- Parameters:
databaseId- The database id where the table will be created- Returns:
- the unique generated names of the partition metadata ddl
-
fromExistingTable
public static PartitionMetadataTableNames fromExistingTable(java.lang.String databaseId, java.lang.String table)
Encapsulates a selected table name. Index names are generated, but will only be used if the given table does not exist. The watermark index will be in the form of"WatermarkIdx_<databaseId>_<uuid>. The createdAt / start timestamp index will be in the form of"CreatedAtIdx_<databaseId>_<uuid>.- Parameters:
databaseId- The database id for the tabletable- The table name to be used- Returns:
- an instance with the table name and generated index names
-
getTableName
public java.lang.String getTableName()
-
getWatermarkIndexName
public java.lang.String getWatermarkIndexName()
-
getCreatedAtIndexName
public java.lang.String getCreatedAtIndexName()
-
equals
public boolean equals(@Nullable java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-