Package org.apache.cassandra.dht
Class Token
- java.lang.Object
-
- org.apache.cassandra.dht.Token
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Token>,RingPosition<Token>
- Direct Known Subclasses:
ByteOrderedPartitioner.BytesToken,LocalPartitioner.LocalToken,Murmur3Partitioner.LongToken,OrderPreservingPartitioner.StringToken,RandomPartitioner.BigIntegerToken
public abstract class Token extends java.lang.Object implements RingPosition<Token>, java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classToken.KeyBoundstatic classToken.TokenFactorystatic classToken.TokenSerializer
-
Field Summary
Fields Modifier and Type Field Description static Token.TokenSerializerserializer
-
Constructor Summary
Constructors Constructor Description Token()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract longgetHeapSize()abstract IPartitionergetPartitioner()TokengetToken()abstract java.lang.ObjectgetTokenValue()abstract TokenincreaseSlightly()Returns a token that is slightly greater than this.booleanisMinimum()Token.KeyBoundmaxKeyBound()Token.KeyBoundminKeyBound()TokenminValue()abstract doublesize(Token next)Returns a measure for the token space covered between this token and next.
-
-
-
Field Detail
-
serializer
public static final Token.TokenSerializer serializer
-
-
Method Detail
-
getPartitioner
public abstract IPartitioner getPartitioner()
- Specified by:
getPartitionerin interfaceRingPosition<Token>
-
getHeapSize
public abstract long getHeapSize()
-
getTokenValue
public abstract java.lang.Object getTokenValue()
-
size
public abstract double size(Token next)
Returns a measure for the token space covered between this token and next. Used by the token allocation algorithm (see CASSANDRA-7032).
-
increaseSlightly
public abstract Token increaseSlightly()
Returns a token that is slightly greater than this. Used to avoid clashes between nodes in separate datacentres trying to use the same token via the token allocation algorithm.
-
getToken
public Token getToken()
- Specified by:
getTokenin interfaceRingPosition<Token>
-
minValue
public Token minValue()
- Specified by:
minValuein interfaceRingPosition<Token>
-
isMinimum
public boolean isMinimum()
- Specified by:
isMinimumin interfaceRingPosition<Token>
-
minKeyBound
public Token.KeyBound minKeyBound()
-
maxKeyBound
public Token.KeyBound maxKeyBound()
-
-