public class LocalPartitioner extends AbstractPartitioner<LocalToken>
Constructor and Description |
---|
LocalPartitioner(AbstractType<?> comparator) |
Modifier and Type | Method and Description |
---|---|
DecoratedKey |
convertFromDiskFormat(java.nio.ByteBuffer key) |
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.
|
LocalToken |
getMinimumToken() |
LocalToken |
getRandomToken() |
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.
|
boolean |
preservesOrder() |
minValue
public LocalPartitioner(AbstractType<?> comparator)
public DecoratedKey convertFromDiskFormat(java.nio.ByteBuffer key)
key
- On disk representationpublic DecoratedKey decorateKey(java.nio.ByteBuffer key)
IPartitioner
key
- the raw, client-facing keypublic Token midpoint(Token left, Token right)
IPartitioner
public LocalToken getMinimumToken()
public LocalToken getToken(java.nio.ByteBuffer key)
public LocalToken getRandomToken()
public Token.TokenFactory getTokenFactory()
public boolean preservesOrder()
public java.util.Map<Token,java.lang.Float> describeOwnership(java.util.List<Token> sortedTokens)
IPartitioner
sortedTokens
- a sorted List of Tokenspublic AbstractType<?> getTokenValidator()
Copyright © 2013 The Apache Software Foundation