public class ByteOrderedPartitioner extends java.lang.Object implements IPartitioner
Modifier and Type | Class and Description |
---|---|
static class |
ByteOrderedPartitioner.BytesToken |
Modifier and Type | Field and Description |
---|---|
static java.math.BigInteger |
BYTE_MASK |
static ByteOrderedPartitioner |
instance |
static ByteOrderedPartitioner.BytesToken |
MINIMUM |
Constructor and Description |
---|
ByteOrderedPartitioner() |
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.
|
ByteOrderedPartitioner.BytesToken |
getMinimumToken() |
ByteOrderedPartitioner.BytesToken |
getRandomToken() |
ByteOrderedPartitioner.BytesToken |
getRandomToken(java.util.Random random) |
ByteOrderedPartitioner.BytesToken |
getToken(java.nio.ByteBuffer key) |
Token.TokenFactory |
getTokenFactory() |
AbstractType<?> |
getTokenValidator() |
ByteOrderedPartitioner.BytesToken |
midpoint(Token lt,
Token rt)
Calculate a Token representing the approximate "middle" of the given
range.
|
AbstractType<?> |
partitionOrdering()
Abstract type that orders the same way as DecoratedKeys provided by this partitioner.
|
boolean |
preservesOrder() |
Token |
split(Token left,
Token right,
double ratioToLeft)
Calculate a Token which take approximate 0 <= ratioToLeft <= 1 ownership of the given range.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMaximumToken, splitter
public static final ByteOrderedPartitioner.BytesToken MINIMUM
public static final java.math.BigInteger BYTE_MASK
public static final ByteOrderedPartitioner instance
public ByteOrderedPartitioner.BytesToken getToken(java.nio.ByteBuffer key)
getToken
in interface IPartitioner
public DecoratedKey decorateKey(java.nio.ByteBuffer key)
IPartitioner
decorateKey
in interface IPartitioner
key
- the raw, client-facing keypublic ByteOrderedPartitioner.BytesToken midpoint(Token lt, Token rt)
IPartitioner
midpoint
in interface IPartitioner
public Token split(Token left, Token right, double ratioToLeft)
IPartitioner
split
in interface IPartitioner
public ByteOrderedPartitioner.BytesToken getMinimumToken()
getMinimumToken
in interface IPartitioner
public ByteOrderedPartitioner.BytesToken getRandomToken()
getRandomToken
in interface IPartitioner
public ByteOrderedPartitioner.BytesToken getRandomToken(java.util.Random random)
getRandomToken
in interface IPartitioner
random
- instance of Random to use when generating the tokenpublic Token.TokenFactory getTokenFactory()
getTokenFactory
in interface IPartitioner
public boolean preservesOrder()
preservesOrder
in interface IPartitioner
public java.util.Map<Token,java.lang.Float> describeOwnership(java.util.List<Token> sortedTokens)
IPartitioner
describeOwnership
in interface IPartitioner
sortedTokens
- a sorted List of Tokenspublic AbstractType<?> getTokenValidator()
getTokenValidator
in interface IPartitioner
public AbstractType<?> partitionOrdering()
IPartitioner
partitionOrdering
in interface IPartitioner
Copyright © 2009- The Apache Software Foundation