voldemort.routing
Class ZoneRoutingStrategy

java.lang.Object
  extended by voldemort.routing.ConsistentRoutingStrategy
      extended by 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(Cluster cluster, java.util.HashMap<java.lang.Integer,java.lang.Integer> zoneReplicationFactor, int numReplicas)
           
ZoneRoutingStrategy(HashFunction hash, Cluster cluster, 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 voldemort.routing.ConsistentRoutingStrategy
getMasterPartition, getNodes, getNumReplicas, getPartitionList, getPartitionToNode, routeRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZoneRoutingStrategy

public ZoneRoutingStrategy(Cluster cluster,
                           java.util.HashMap<java.lang.Integer,java.lang.Integer> zoneReplicationFactor,
                           int numReplicas)

ZoneRoutingStrategy

public ZoneRoutingStrategy(HashFunction hash,
                           Cluster cluster,
                           java.util.HashMap<java.lang.Integer,java.lang.Integer> zoneReplicationFactor,
                           int numReplicas)
Method Detail

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, Chinmay Soman, Vinoth Chandar, Zhongjie Wu