public class LocalPartitioner extends java.lang.Object implements IPartitioner
Modifier and Type | Class and Description |
---|---|
class |
LocalPartitioner.LocalToken |
Constructor and Description |
---|
LocalPartitioner(AbstractType<?> comparator) |
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.
|
LocalPartitioner.LocalToken |
getMinimumToken() |
LocalPartitioner.LocalToken |
getRandomToken() |
LocalPartitioner.LocalToken |
getToken(java.nio.ByteBuffer key) |
Token.TokenFactory |
getTokenFactory() |
AbstractType<?> |
getTokenValidator() |
Token |
midpoint(Token left,
Token right)
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() |
public LocalPartitioner(AbstractType<?> comparator)
public DecoratedKey decorateKey(java.nio.ByteBuffer key)
IPartitioner
decorateKey
in interface IPartitioner
key
- the raw, client-facing keypublic Token midpoint(Token left, Token right)
IPartitioner
midpoint
in interface IPartitioner
public LocalPartitioner.LocalToken getMinimumToken()
getMinimumToken
in interface IPartitioner
public LocalPartitioner.LocalToken getToken(java.nio.ByteBuffer key)
getToken
in interface IPartitioner
public LocalPartitioner.LocalToken getRandomToken()
getRandomToken
in interface IPartitioner
public 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 © 2017 The Apache Software Foundation