Package org.apache.cassandra.db
Class BufferDecoratedKey
java.lang.Object
org.apache.cassandra.db.DecoratedKey
org.apache.cassandra.db.BufferDecoratedKey
- All Implemented Interfaces:
Comparable<PartitionPosition>,PartitionPosition,RingPosition<PartitionPosition>,ByteComparable,IFilter.FilterKey
- Direct Known Subclasses:
CachedHashDecoratedKey,PreHashedDecoratedKey
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.bytecomparable.ByteComparable
ByteComparable.VersionNested classes/interfaces inherited from interface org.apache.cassandra.db.PartitionPosition
PartitionPosition.ForKey, PartitionPosition.Kind, PartitionPosition.RowPositionSerializer -
Field Summary
Fields inherited from class org.apache.cassandra.db.DecoratedKey
comparatorFields inherited from interface org.apache.cassandra.utils.bytecomparable.ByteComparable
EMPTYFields inherited from interface org.apache.cassandra.db.PartitionPosition
serializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BufferDecoratedKeyfromByteComparable(ByteComparable byteComparable, ByteComparable.Version version, IPartitioner partitioner) A factory method that translates the given byte-comparable representation to aBufferDecoratedKeyinstance.getKey()intMethods inherited from class org.apache.cassandra.db.DecoratedKey
asComparableBound, asComparableBytes, compareTo, compareTo, equals, filterHash, getPartitioner, getToken, hashCode, isMinimum, keyComparableBytes, keyFromByteSource, kind, minValue, retainable, toCQLString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cassandra.utils.bytecomparable.ByteComparable
byteComparableAsStringMethods inherited from interface org.apache.cassandra.utils.IFilter.FilterKey
filterHashLowerBits
-
Constructor Details
-
BufferDecoratedKey
-
-
Method Details
-
getKey
- Specified by:
getKeyin classDecoratedKey
-
getKeyLength
public int getKeyLength()- Specified by:
getKeyLengthin classDecoratedKey
-
fromByteComparable
public static BufferDecoratedKey fromByteComparable(ByteComparable byteComparable, ByteComparable.Version version, IPartitioner partitioner) A factory method that translates the given byte-comparable representation to aBufferDecoratedKeyinstance. If the given byte comparable doesn't represent the encoding of a buffer decorated key, anything from a wide variety of throwables may be thrown (e.g.AssertionError,IndexOutOfBoundsException,IllegalStateException, etc.).- Parameters:
byteComparable- A byte-comparable representation (presumably of aBufferDecoratedKeyinstance).version- The encoding version used for the given byte comparable.partitioner- The partitioner of the encoded decorated key. Needed in order to correctly decode the token bytes of the key.- Returns:
- A new
BufferDecoratedKeyinstance, corresponding to the given byte-comparable representation. If we were to callDecoratedKey.asComparableBytes(Version)on the returned object, we should get aByteSourceequal to the one of the input byte comparable.
-