Package org.apache.cassandra.dht
Class Token.KeyBound
java.lang.Object
org.apache.cassandra.dht.Token.KeyBound
- All Implemented Interfaces:
Comparable<PartitionPosition>,PartitionPosition,RingPosition<PartitionPosition>,ByteComparable
- Enclosing class:
- Token
-
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
FieldsFields inherited from interface org.apache.cassandra.utils.bytecomparable.ByteComparable
EMPTYFields inherited from interface org.apache.cassandra.db.PartitionPosition
serializer -
Method Summary
Modifier and TypeMethodDescriptionasComparableBound(boolean before) Produce a byte-comparable representation for the position before or after the key.asComparableBytes(ByteComparable.Version version) Produce a prefix-free byte-comparable representation of the key, i.e.intbooleangetToken()inthashCode()booleankind()minValue()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cassandra.utils.bytecomparable.ByteComparable
byteComparableAsString
-
Field Details
-
isMinimumBound
public final boolean isMinimumBound
-
-
Method Details
-
getToken
- Specified by:
getTokenin interfaceRingPosition<PartitionPosition>
-
compareTo
- Specified by:
compareToin interfaceComparable<PartitionPosition>
-
asComparableBytes
Description copied from interface:PartitionPositionProduce 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:
asComparableBytesin interfaceByteComparable- Specified by:
asComparableBytesin interfacePartitionPosition
-
asComparableBound
Description copied from interface:PartitionPositionProduce 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:
asComparableBoundin interfacePartitionPosition
-
getPartitioner
- Specified by:
getPartitionerin interfaceRingPosition<PartitionPosition>
-
minValue
- Specified by:
minValuein interfaceRingPosition<PartitionPosition>
-
isMinimum
public boolean isMinimum()- Specified by:
isMinimumin interfacePartitionPosition- Specified by:
isMinimumin interfaceRingPosition<PartitionPosition>
-
kind
- Specified by:
kindin interfacePartitionPosition
-
equals
-
hashCode
public int hashCode() -
toString
-