Package org.apache.cassandra.dht
Class Murmur3Partitioner.LongToken
- java.lang.Object
-
- org.apache.cassandra.dht.Token
-
- org.apache.cassandra.dht.Murmur3Partitioner.LongToken
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Token>,RingPosition<Token>
- Enclosing class:
- Murmur3Partitioner
public static class Murmur3Partitioner.LongToken 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 Modifier and Type Field Description longtoken-
Fields inherited from class org.apache.cassandra.dht.Token
serializer
-
-
Constructor Summary
Constructors Constructor Description LongToken(long token)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Token o)Murmur3Partitioner.LongTokendecreaseSlightly()booleanequals(java.lang.Object obj)longgetHeapSize()IPartitionergetPartitioner()java.lang.ObjectgetTokenValue()inthashCode()Murmur3Partitioner.LongTokenincreaseSlightly()Returns a token that is slightly greater than this.static java.nio.ByteBufferkeyForToken(long token)static java.nio.ByteBufferkeyForToken(Murmur3Partitioner.LongToken token)Reverses murmur3 to find a possible 16 byte key that generates a given tokendoublesize(Token next)Returns a measure for the token space covered between this token and next.java.lang.StringtoString()-
Methods inherited from class org.apache.cassandra.dht.Token
getToken, isMinimum, maxKeyBound, minKeyBound, minValue
-
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(Token o)
-
getPartitioner
public IPartitioner getPartitioner()
- Specified by:
getPartitionerin interfaceRingPosition<Token>- Specified by:
getPartitionerin classToken
-
getHeapSize
public long getHeapSize()
- Specified by:
getHeapSizein classToken
-
getTokenValue
public java.lang.Object getTokenValue()
- Specified by:
getTokenValuein classToken
-
size
public double size(Token next)
Description copied from class:TokenReturns a measure for the token space covered between this token and next. Used by the token allocation algorithm (see CASSANDRA-7032).
-
increaseSlightly
public Murmur3Partitioner.LongToken increaseSlightly()
Description copied from class:TokenReturns 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:
increaseSlightlyin classToken
-
decreaseSlightly
public Murmur3Partitioner.LongToken decreaseSlightly()
-
keyForToken
public static java.nio.ByteBuffer keyForToken(long token)
-
keyForToken
public static java.nio.ByteBuffer keyForToken(Murmur3Partitioner.LongToken token)
Reverses murmur3 to find a possible 16 byte key that generates a given token
-
-