org.apache.cassandra.dht
Class RandomPartitioner
java.lang.Object
org.apache.cassandra.dht.RandomPartitioner
- All Implemented Interfaces:
- IPartitioner
public class RandomPartitioner
- extends java.lang.Object
- implements IPartitioner
This class generates a BigIntegerToken using MD5 hash.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomPartitioner
public RandomPartitioner()
decorateKey
public java.lang.String decorateKey(java.lang.String key)
- Description copied from interface:
IPartitioner
- transform key to on-disk format s.t. keys are stored in node comparison order.
this lets bootstrap rip out parts of the sstable sequentially instead of doing random seeks.
- Specified by:
decorateKey
in interface IPartitioner
- Parameters:
key
- the raw, client-facing key
- Returns:
- decorated on-disk version of key
undecorateKey
public java.lang.String undecorateKey(java.lang.String decoratedKey)
- Specified by:
undecorateKey
in interface IPartitioner
getDecoratedKeyComparator
public java.util.Comparator<java.lang.String> getDecoratedKeyComparator()
- Specified by:
getDecoratedKeyComparator
in interface IPartitioner
getReverseDecoratedKeyComparator
public java.util.Comparator<java.lang.String> getReverseDecoratedKeyComparator()
- Specified by:
getReverseDecoratedKeyComparator
in interface IPartitioner
getDefaultToken
public BigIntegerToken getDefaultToken()
- Specified by:
getDefaultToken
in interface IPartitioner
getTokenFactory
public Token.TokenFactory<java.math.BigInteger> getTokenFactory()
- Specified by:
getTokenFactory
in interface IPartitioner
getInitialToken
public Token getInitialToken(java.lang.String key)
- Specified by:
getInitialToken
in interface IPartitioner
- Returns:
- the token to use for this node if none was saved
Copyright © 2009 The Apache Software Foundation