Interface PrimaryKey

    • Method Detail

      • kind

        PrimaryKey.Kind kind()
        Returns the PrimaryKey.Kind of the PrimaryKey. The PrimaryKey.Kind is used locally in the Comparable.compareTo(Object) methods to determine how far the comparision needs to go between keys.

        The PrimaryKey.Kind values have a categorization of isClustering. This indicates whether the key belongs to a table with clustering tables or not.

      • partitionKey

        DecoratedKey partitionKey()
        Returns the DecoratedKey representing the partition key of the PrimaryKey.

        Note: This cannot be null but some PrimaryKey implementations can throw UnsupportedOperationException if they do not support partition keys.

      • clustering

        Clustering<?> clustering()
        Returns the Clustering representing the clustering component of the PrimaryKey.

        Note: This cannot be null but some PrimaryKey implementations can throw UnsupportedOperationException if they do not support clustering columns.

      • asComparableBytes

        ByteSource asComparableBytes​(ByteComparable.Version version)
        Returns the PrimaryKey as a ByteSource byte comparable representation.

        It is important that these representations are only ever used with byte comparables using the same elements. This means that asComparableBytes responses can only be used together from the same PrimaryKey implementation.

        Specified by:
        asComparableBytes in interface ByteComparable
        Parameters:
        version - the ByteComparable.Version to use for the implementation
        Returns:
        the ByteSource byte comparable.
        Throws:
        java.lang.UnsupportedOperationException - for PrimaryKey implementations that are not byte-comparable
      • compareToStrict

        default int compareToStrict​(PrimaryKey o)