Interface PrimaryKey
- All Superinterfaces:
ByteComparable,Comparable<PrimaryKey>
Representation of the primary key for a row consisting of the
DecoratedKey and
Clustering associated with a Row.
The PrimaryKey.Factory.TokenOnlyPrimaryKey is used by the StorageAttachedIndexSearcher to
position the search within the query range.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic enumSee the javadoc forkind()for how this enum is used.Nested classes/interfaces inherited from interface org.apache.cassandra.utils.bytecomparable.ByteComparable
ByteComparable.Version -
Field Summary
Fields inherited from interface org.apache.cassandra.utils.bytecomparable.ByteComparable
EMPTY -
Method Summary
Modifier and TypeMethodDescriptionasComparableBytes(ByteComparable.Version version) Returns thePrimaryKeyas aByteSourcebyte comparable representation.Clustering<?>Returns theClusteringrepresenting the clustering component of thePrimaryKey.default intcompareTo(PrimaryKey key, boolean strict) booleankind()Returns thePrimaryKey.Kindof thePrimaryKey.Returns theDecoratedKeyrepresenting the partition key of thePrimaryKey.token()Returns theTokencomponent of thePrimaryKeydefault PrimaryKeytoStatic()Methods inherited from interface org.apache.cassandra.utils.bytecomparable.ByteComparable
byteComparableAsStringMethods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
kind
PrimaryKey.Kind kind()Returns thePrimaryKey.Kindof thePrimaryKey. ThePrimaryKey.Kindis used locally in theComparable.compareTo(Object)methods to determine how far the comparision needs to go between keys.The
PrimaryKey.Kindvalues have a categorization ofisClustering. This indicates whether the key belongs to a table with clustering tables or not. -
token
Token token()Returns theTokencomponent of thePrimaryKey -
partitionKey
DecoratedKey partitionKey()Returns theDecoratedKeyrepresenting the partition key of thePrimaryKey.Note: This cannot be null but some
PrimaryKeyimplementations can throwUnsupportedOperationExceptionif they do not support partition keys. -
clustering
Clustering<?> clustering()Returns theClusteringrepresenting the clustering component of thePrimaryKey.Note: This cannot be null but some
PrimaryKeyimplementations can throwUnsupportedOperationExceptionif they do not support clustering columns. -
asComparableBytes
Returns thePrimaryKeyas aByteSourcebyte comparable representation.It is important that these representations are only ever used with byte comparables using the same elements. This means that
asComparableBytesresponses can only be used together from the samePrimaryKeyimplementation.- Specified by:
asComparableBytesin interfaceByteComparable- Parameters:
version- theByteComparable.Versionto use for the implementation- Returns:
- the
ByteSourcebyte comparable. - Throws:
UnsupportedOperationException- forPrimaryKeyimplementations that are not byte-comparable
-
toStatic
-
compareTo
-
equals
-