Package org.apache.cassandra.dht
Class LocalPartitioner.LocalToken
- java.lang.Object
-
- org.apache.cassandra.dht.Token
-
- org.apache.cassandra.dht.LocalPartitioner.LocalToken
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Token>
,RingPosition<Token>
- Enclosing class:
- LocalPartitioner
public class LocalPartitioner.LocalToken extends Token
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.dht.Token
Token.KeyBound, Token.TokenFactory, Token.TokenSerializer
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.dht.Token
serializer
-
-
Constructor Summary
Constructors Constructor Description LocalToken(java.nio.ByteBuffer token)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Token o)
boolean
equals(java.lang.Object obj)
long
getHeapSize()
IPartitioner
getPartitioner()
C
getTokenValue()
int
hashCode()
Token
increaseSlightly()
Returns a token that is slightly greater than this.double
size(Token next)
Returns a measure for the token space covered between this token and next.java.lang.String
toString()
-
Methods inherited from class org.apache.cassandra.dht.Token
getToken, isMinimum, maxKeyBound, minKeyBound, minValue
-
-
-
-
Method Detail
-
toString
public java.lang.String toString()
-
compareTo
public int compareTo(Token o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Token>
-
hashCode
public int hashCode()
-
equals
public boolean equals(java.lang.Object obj)
-
getPartitioner
public IPartitioner getPartitioner()
- Specified by:
getPartitioner
in interfaceRingPosition<Token>
- Specified by:
getPartitioner
in classToken
-
getHeapSize
public long getHeapSize()
- Specified by:
getHeapSize
in classToken
-
getTokenValue
public C getTokenValue()
- Specified by:
getTokenValue
in classToken
-
size
public double size(Token next)
Description copied from class:Token
Returns a measure for the token space covered between this token and next. Used by the token allocation algorithm (see CASSANDRA-7032).
-
increaseSlightly
public Token increaseSlightly()
Description copied from class:Token
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.- Specified by:
increaseSlightly
in classToken
-
-