voldemort.routing
Class ZoneRoutingStrategy
java.lang.Object
voldemort.routing.ConsistentRoutingStrategy
voldemort.routing.ZoneRoutingStrategy
- All Implemented Interfaces:
- RoutingStrategy
public class ZoneRoutingStrategy
- extends ConsistentRoutingStrategy
A Zone Routing strategy that sits on top of the Consistent Routing strategy
such that each request goes to zone specific replicas
|
Constructor Summary |
ZoneRoutingStrategy(java.util.Collection<Node> nodes,
java.util.HashMap<java.lang.Integer,java.lang.Integer> zoneReplicationFactor,
int numReplicas)
|
ZoneRoutingStrategy(HashFunction hash,
java.util.Collection<Node> nodes,
java.util.HashMap<java.lang.Integer,java.lang.Integer> zoneReplicationFactor,
int numReplicas)
|
|
Method Summary |
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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZoneRoutingStrategy
public ZoneRoutingStrategy(java.util.Collection<Node> nodes,
java.util.HashMap<java.lang.Integer,java.lang.Integer> zoneReplicationFactor,
int numReplicas)
ZoneRoutingStrategy
public ZoneRoutingStrategy(HashFunction hash,
java.util.Collection<Node> nodes,
java.util.HashMap<java.lang.Integer,java.lang.Integer> zoneReplicationFactor,
int numReplicas)
getReplicatingPartitionList
public java.util.List<java.lang.Integer> getReplicatingPartitionList(int index)
- Get the replication partitions list for the given partition.
- Specified by:
getReplicatingPartitionList in interface RoutingStrategy- Overrides:
getReplicatingPartitionList in class ConsistentRoutingStrategy
- Parameters:
index - Partition id for which we are generating the preference list
- Returns:
- The List of partitionId where this partition is replicated.
getType
public java.lang.String getType()
- Description copied from interface:
RoutingStrategy
- Get the type of RoutingStrategyType
- Specified by:
getType in interface RoutingStrategy- Overrides:
getType in class ConsistentRoutingStrategy
- Returns:
- RoutingStrategyType
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao