|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cassandra.dht.RandomPartitioner
public class RandomPartitioner
This class generates a BigIntegerToken using MD5 hash.
| Field Summary | |
|---|---|
static BigIntegerToken |
MINIMUM
|
static java.math.BigInteger |
TWO
|
| Constructor Summary | |
|---|---|
RandomPartitioner()
|
|
| Method Summary | |
|---|---|
DecoratedKey<BigIntegerToken> |
convertFromDiskFormat(java.lang.String key)
Convert the on disk representation to a DecoratedKey object |
java.lang.String |
convertToDiskFormat(DecoratedKey<BigIntegerToken> key)
Convert the DecoratedKey to the on disk format used for this partitioner. |
DecoratedKey<BigIntegerToken> |
decorateKey(java.lang.String key)
Transform key to object representation of the on-disk format. |
BigIntegerToken |
getMinimumToken()
|
BigIntegerToken |
getRandomToken()
|
BigIntegerToken |
getToken(java.lang.String key)
|
Token.TokenFactory<java.math.BigInteger> |
getTokenFactory()
|
BigIntegerToken |
midpoint(BigIntegerToken ltoken,
BigIntegerToken rtoken)
Calculate a Token representing the approximate "middle" of the given range. |
boolean |
preservesOrder()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.math.BigInteger TWO
public static final BigIntegerToken MINIMUM
| Constructor Detail |
|---|
public RandomPartitioner()
| Method Detail |
|---|
public DecoratedKey<BigIntegerToken> decorateKey(java.lang.String key)
IPartitioner
decorateKey in interface IPartitioner<BigIntegerToken>key - the raw, client-facing key
public DecoratedKey<BigIntegerToken> convertFromDiskFormat(java.lang.String key)
IPartitioner
convertFromDiskFormat in interface IPartitioner<BigIntegerToken>key - On disk representation
public java.lang.String convertToDiskFormat(DecoratedKey<BigIntegerToken> key)
IPartitioner
convertToDiskFormat in interface IPartitioner<BigIntegerToken>key - The DecoratedKey in question
public BigIntegerToken midpoint(BigIntegerToken ltoken,
BigIntegerToken rtoken)
IPartitioner
midpoint in interface IPartitioner<BigIntegerToken>public BigIntegerToken getMinimumToken()
getMinimumToken in interface IPartitioner<BigIntegerToken>public BigIntegerToken getRandomToken()
getRandomToken in interface IPartitioner<BigIntegerToken>public Token.TokenFactory<java.math.BigInteger> getTokenFactory()
getTokenFactory in interface IPartitioner<BigIntegerToken>public boolean preservesOrder()
preservesOrder in interface IPartitioner<BigIntegerToken>public BigIntegerToken getToken(java.lang.String key)
getToken in interface IPartitioner<BigIntegerToken>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||