Class TableId


  • public class TableId
    extends java.lang.Object
    The unique identifier of a table.

    This is essentially a UUID, but we wrap it as it's used quite a bit in the code and having a nicely named class make the code more readable.

    • Method Detail

      • fromUUID

        public static TableId fromUUID​(java.util.UUID id)
      • generate

        public static TableId generate()
      • fromString

        public static TableId fromString​(java.lang.String idString)
      • tableNameAndIdFromFilename

        @Nullable
        public static Pair<java.lang.String,​TableId> tableNameAndIdFromFilename​(java.lang.String filename)
      • forSystemTable

        public static TableId forSystemTable​(java.lang.String keyspace,
                                             java.lang.String table)
        Creates the UUID of a system table. This is deterministically based on the table name as system tables are hardcoded and initialized independently on each node (they don't go through a CREATE), but we still want them to have the same ID everywhere. We shouldn't use this for any other table.
      • unsafeDeterministic

        public static TableId unsafeDeterministic​(java.lang.String keyspace,
                                                  java.lang.String table)
      • toHexString

        public java.lang.String toHexString()
      • asUUID

        public java.util.UUID asUUID()
      • hashCode

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

        public final boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

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

        public void serialize​(java.io.DataOutput out)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • serializedSize

        public int serializedSize()
      • deserialize

        public static TableId deserialize​(java.io.DataInput in)
                                   throws java.io.IOException
        Throws:
        java.io.IOException