Package org.apache.cassandra.db
Interface PartitionPosition
-
- All Superinterfaces:
ByteComparable
,java.lang.Comparable<PartitionPosition>
,RingPosition<PartitionPosition>
- All Known Implementing Classes:
BufferDecoratedKey
,CachedHashDecoratedKey
,DecoratedKey
,NativeDecoratedKey
,PreHashedDecoratedKey
,Token.KeyBound
public interface PartitionPosition extends RingPosition<PartitionPosition>, ByteComparable
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PartitionPosition.ForKey
static class
PartitionPosition.Kind
static class
PartitionPosition.RowPositionSerializer
-
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.bytecomparable.ByteComparable
ByteComparable.Version
-
-
Field Summary
Fields Modifier and Type Field Description static PartitionPosition.RowPositionSerializer
serializer
-
Fields inherited from interface org.apache.cassandra.utils.bytecomparable.ByteComparable
EMPTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ByteComparable
asComparableBound(boolean before)
Produce a byte-comparable representation for the position before or after the key.ByteSource
asComparableBytes(ByteComparable.Version version)
Produce a prefix-free byte-comparable representation of the key, i.e.boolean
isMinimum()
PartitionPosition.Kind
kind()
-
Methods inherited from interface org.apache.cassandra.utils.bytecomparable.ByteComparable
byteComparableAsString
-
Methods inherited from interface org.apache.cassandra.dht.RingPosition
getPartitioner, getToken, minValue
-
-
-
-
Field Detail
-
serializer
static final PartitionPosition.RowPositionSerializer serializer
-
-
Method Detail
-
kind
PartitionPosition.Kind kind()
-
isMinimum
boolean isMinimum()
- Specified by:
isMinimum
in interfaceRingPosition<PartitionPosition>
-
asComparableBytes
ByteSource asComparableBytes(ByteComparable.Version version)
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 interfaceByteComparable
-
asComparableBound
ByteComparable asComparableBound(boolean before)
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.
-
-