|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.routing.ConsistentRoutingStrategy
public class ConsistentRoutingStrategy
A Routing strategy that routes each request to the first N nodes where N is a user defined replication factor. The mapping is computed by creating partitions of a fixed size, and maintaining a mapping from partition tag to Node. These nodes are mapped onto a ring. A preference list of nodes to route to is created by taking the partition into which the key hashes, and then taking the next N nodes on the ring.
Constructor Summary | |
---|---|
ConsistentRoutingStrategy(Cluster cluster,
int numReplicas)
|
|
ConsistentRoutingStrategy(HashFunction hash,
Cluster cluster,
int numReplicas)
|
|
ConsistentRoutingStrategy(HashFunction hash,
java.util.Collection<Node> nodes,
int numReplicas)
|
Method Summary | |
---|---|
java.lang.Integer |
getMasterPartition(byte[] key)
Obtain the master partition for a given key |
java.util.Set<Node> |
getNodes()
Get the collection of nodes that are candidates for routing. |
int |
getNumReplicas()
Return the number of replicas |
java.util.List<java.lang.Integer> |
getPartitionList(byte[] key)
Get the partition list for the given key. |
Node[] |
getPartitionToNode()
|
java.util.List<java.lang.Integer> |
getReplicatingPartitionList(int index)
Get the replication partitions list for the given partition. |
java.lang.String |
getType()
Get the type of RoutingStrategyType |
java.util.List<Node> |
routeRequest(byte[] key)
Get the node preference list for the given key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConsistentRoutingStrategy(Cluster cluster, int numReplicas)
public ConsistentRoutingStrategy(HashFunction hash, Cluster cluster, int numReplicas)
public ConsistentRoutingStrategy(HashFunction hash, java.util.Collection<Node> nodes, int numReplicas)
Method Detail |
---|
public int getNumReplicas()
RoutingStrategy
getNumReplicas
in interface RoutingStrategy
public Node[] getPartitionToNode()
public java.util.List<Node> routeRequest(byte[] key)
RoutingStrategy
routeRequest
in interface RoutingStrategy
key
- The key the operation is operating on
public java.util.List<java.lang.Integer> getReplicatingPartitionList(int index)
RoutingStrategy
getReplicatingPartitionList
in interface RoutingStrategy
public java.lang.Integer getMasterPartition(byte[] key)
getMasterPartition
in interface RoutingStrategy
key
-
public java.util.Set<Node> getNodes()
RoutingStrategy
getNodes
in interface RoutingStrategy
public java.util.List<java.lang.Integer> getPartitionList(byte[] key)
RoutingStrategy
RoutingStrategy.getReplicatingPartitionList(int)
that
takes a key. So, would be good to rename this also as
getReplicatingPartitionList
getPartitionList
in interface RoutingStrategy
key
- The key the operation is operating on
public java.lang.String getType()
RoutingStrategy
getType
in interface RoutingStrategy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |