Package org.apache.cassandra.schema
Class TableId
- java.lang.Object
-
- org.apache.cassandra.schema.TableId
-
public class TableId extends java.lang.ObjectThe 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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.UUIDasUUID()static TableIddeserialize(java.io.DataInput in)booleanequals(java.lang.Object o)static TableIdforSystemTable(java.lang.String keyspace, java.lang.String table)Creates the UUID of a system table.static TableIdfromString(java.lang.String idString)static TableIdfromUUID(java.util.UUID id)static TableIdgenerate()inthashCode()voidserialize(java.io.DataOutput out)intserializedSize()java.lang.StringtoHexString()java.lang.StringtoString()static TableIdunsafeDeterministic(java.lang.String keyspace, java.lang.String table)
-
-
-
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)
-
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:
hashCodein classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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
-
-