Class DecoratedKey

    • Field Detail

      • comparator

        public static final java.util.Comparator<DecoratedKey> comparator
    • Constructor Detail

      • DecoratedKey

        public DecoratedKey​(Token token)
    • Method Detail

      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • asComparableBytes

        public ByteSource asComparableBytes​(ByteComparable.Version version)
        Description copied from interface: PartitionPosition
        Produce a prefix-free byte-comparable representation of the key, i.e. such a sequence of bytes that any pair x, y of valid positions (with the same key column types and partitioner), x.compareTo(y) == compareLexicographicallyUnsigned(x.asComparableBytes(), y.asComparableBytes()) and x.asComparableBytes() is not a prefix of y.asComparableBytes() We use a two-component tuple for decorated keys, and a one-component tuple for key bounds, where the terminator byte is chosen to yield the correct comparison result. No decorated key can be a prefix of another (per the tuple encoding), and no key bound can be a prefix of one because it uses a terminator byte that is different from the tuple separator.
        Specified by:
        asComparableBytes in interface ByteComparable
        Specified by:
        asComparableBytes in interface PartitionPosition
      • asComparableBound

        public ByteComparable asComparableBound​(boolean before)
        Description copied from interface: PartitionPosition
        Produce a byte-comparable representation for the position before or after the key. This does nothing for token boundaries (which are already at a position between valid keys), and changes the terminator byte for keys.
        Specified by:
        asComparableBound in interface PartitionPosition
      • toString

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

        public java.lang.String toCQLString​(TableMetadata metadata)
        Returns a CQL representation of this key.
        Parameters:
        metadata - the metadata of the table that this key belogs to
        Returns:
        a CQL representation of this key
      • getKey

        public abstract java.nio.ByteBuffer getKey()
      • getKeyLength

        public abstract int getKeyLength()
      • retainable

        public DecoratedKey retainable()
        If this key occupies only part of a larger buffer, allocate a new buffer that is only as large as necessary. Otherwise, it returns this key.
      • filterHash

        public void filterHash​(long[] dest)
        Description copied from interface: IFilter.FilterKey
        Places the murmur3 hash of the key in the given long array of size at least two.
        Specified by:
        filterHash in interface IFilter.FilterKey