Class TableId

java.lang.Object
org.apache.cassandra.schema.TableId

public class TableId extends 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 Details

    • fromUUID

      public static TableId fromUUID(UUID id)
    • generate

      public static TableId generate()
    • fromString

      public static TableId fromString(String idString)
    • tableNameAndIdFromFilename

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

      public static TableId forSystemTable(String keyspace, 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(String keyspace, String table)
    • toHexString

      public String toHexString()
    • asUUID

      public UUID asUUID()
    • hashCode

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

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

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

      public void serialize(DataOutput out) throws IOException
      Throws:
      IOException
    • serializedSize

      public int serializedSize()
    • deserialize

      public static TableId deserialize(DataInput in) throws IOException
      Throws:
      IOException