public class RandomPartitioner
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.math.BigInteger |
MAXIMUM |
static BigIntegerToken |
MINIMUM |
static java.math.BigInteger |
ZERO |
| Constructor and Description |
|---|
RandomPartitioner() |
| Modifier and Type | Method and Description |
|---|---|
DecoratedKey |
decorateKey(java.nio.ByteBuffer key)
Transform key to object representation of the on-disk format.
|
java.util.Map<Token,java.lang.Float> |
describeOwnership(java.util.List<Token> sortedTokens)
Calculate the deltas between tokens in the ring in order to compare
relative sizes.
|
long |
getHeapSizeOf(Token token) |
BigIntegerToken |
getMinimumToken() |
BigIntegerToken |
getRandomToken() |
BigIntegerToken |
getToken(java.nio.ByteBuffer key) |
Token.TokenFactory |
getTokenFactory() |
AbstractType<?> |
getTokenValidator() |
Token |
midpoint(Token ltoken,
Token rtoken)
Calculate a Token representing the approximate "middle" of the given
range.
|
<R extends RingPosition<R>> |
minValue(java.lang.Class<R> klass) |
boolean |
preservesOrder() |
public static final java.math.BigInteger ZERO
public static final BigIntegerToken MINIMUM
public static final java.math.BigInteger MAXIMUM
public DecoratedKey decorateKey(java.nio.ByteBuffer key)
IPartitionerkey - the raw, client-facing keypublic Token midpoint(Token ltoken, Token rtoken)
IPartitionerpublic BigIntegerToken getMinimumToken()
public BigIntegerToken getRandomToken()
public Token.TokenFactory getTokenFactory()
public boolean preservesOrder()
public BigIntegerToken getToken(java.nio.ByteBuffer key)
public long getHeapSizeOf(Token token)
public java.util.Map<Token,java.lang.Float> describeOwnership(java.util.List<Token> sortedTokens)
IPartitionersortedTokens - a sorted List of Tokenspublic AbstractType<?> getTokenValidator()
public <R extends RingPosition<R>> R minValue(java.lang.Class<R> klass)
minValue in interface IPartitionerCopyright © 2015 The Apache Software Foundation