org.apache.cassandra.dht
Interface IPartitioner<T extends Token>
- All Known Implementing Classes:
- AbstractByteOrderedPartitioner, ByteOrderedPartitioner, CollatingOrderPreservingPartitioner, LocalPartitioner, OrderPreservingPartitioner, RandomPartitioner
public interface IPartitioner<T extends Token>
convertFromDiskFormat
DecoratedKey<T> convertFromDiskFormat(java.nio.ByteBuffer key)
- Parameters:
key
- On disk representation
- Returns:
- DecoratedKey object
decorateKey
DecoratedKey<T> decorateKey(java.nio.ByteBuffer key)
- Transform key to object representation of the on-disk format.
- Parameters:
key
- the raw, client-facing key
- Returns:
- decorated version of key
midpoint
Token midpoint(Token left,
Token right)
- Calculate a Token representing the approximate "middle" of the given
range.
- Returns:
- The approximate midpoint between left and right.
getMinimumToken
T getMinimumToken()
- Returns:
- The minimum possible Token in the range that is being partitioned.
getToken
T getToken(java.nio.ByteBuffer key)
- Returns:
- a Token that can be used to route a given key
(This is NOT a method to create a Token from its string representation;
for that, use TokenFactory.fromString.)
getRandomToken
T getRandomToken()
- Returns:
- a randomly generated token
getTokenFactory
Token.TokenFactory getTokenFactory()
preservesOrder
boolean preservesOrder()
- Returns:
- True if the implementing class preserves key order in the Tokens
it generates.
Copyright © 2010 The Apache Software Foundation