|
||||||||||
| 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(java.util.Collection<Node> nodes,
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(java.util.Collection<Node> nodes,
int numReplicas)
public ConsistentRoutingStrategy(HashFunction hash,
java.util.Collection<Node> nodes,
int numReplicas)
| Method Detail |
|---|
public int getNumReplicas()
RoutingStrategy
getNumReplicas in interface RoutingStrategypublic Node[] getPartitionToNode()
public java.util.List<Node> routeRequest(byte[] key)
RoutingStrategy
routeRequest in interface RoutingStrategykey - The key the operation is operating on
public java.util.List<java.lang.Integer> getReplicatingPartitionList(int index)
RoutingStrategy
getReplicatingPartitionList in interface RoutingStrategypublic java.lang.Integer getMasterPartition(byte[] key)
getMasterPartition in interface RoutingStrategykey -
public java.util.Set<Node> getNodes()
RoutingStrategy
getNodes in interface RoutingStrategypublic java.util.List<java.lang.Integer> getPartitionList(byte[] key)
RoutingStrategy
getPartitionList in interface RoutingStrategykey - 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 | |||||||||