org.apache.cassandra.dht
Class OrderPreservingPartitioner

java.lang.Object
  extended by org.apache.cassandra.dht.OrderPreservingPartitioner
All Implemented Interfaces:
IPartitioner

public class OrderPreservingPartitioner
extends java.lang.Object
implements IPartitioner


Constructor Summary
OrderPreservingPartitioner()
           
 
Method Summary
 java.lang.String decorateKey(java.lang.String key)
          transform key to on-disk format s.t.
 java.util.Comparator<java.lang.String> getDecoratedKeyComparator()
           
 StringToken getDefaultToken()
           
 Token getInitialToken(java.lang.String key)
           
 java.util.Comparator<java.lang.String> getReverseDecoratedKeyComparator()
           
 Token.TokenFactory<java.lang.String> getTokenFactory()
           
 java.lang.String undecorateKey(java.lang.String decoratedKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderPreservingPartitioner

public OrderPreservingPartitioner()
Method Detail

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 StringToken getDefaultToken()
Specified by:
getDefaultToken in interface IPartitioner

getTokenFactory

public Token.TokenFactory<java.lang.String> 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