Class PartitionMetadataTableNames

  • All Implemented Interfaces:
    java.io.Serializable

    public class PartitionMetadataTableNames
    extends java.lang.Object
    implements java.io.Serializable
    Configuration for a partition metadata table. It encapsulates the name of the metadata table and indexes.
    See Also:
    Serialized Form
    • Constructor Detail

      • PartitionMetadataTableNames

        public PartitionMetadataTableNames​(java.lang.String tableName,
                                           java.lang.String watermarkIndexName,
                                           java.lang.String createdAtIndexName)
    • 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 table
        table - 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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object