voldemort.routing
Interface RoutingStrategy

All Known Implementing Classes:
ConsistentRoutingStrategy, RouteToAllLocalPrefStrategy, RouteToAllStrategy, ZoneRoutingStrategy

public interface RoutingStrategy

A routing strategy maps puts and gets to an ordered "preference list" of servers. The preference list is the order under which operations will be completed in the absence of failures.


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.
 java.util.List<java.lang.Integer> getReplicatingPartitionList(int partitionId)
          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.
 

Method Detail

getType

java.lang.String getType()
Get the type of RoutingStrategyType

Returns:
RoutingStrategyType

routeRequest

java.util.List<Node> routeRequest(byte[] key)
Get the node preference list for the given key. The preference list is a list of nodes to perform an operation on.

Parameters:
key - The key the operation is operating on
Returns:
The preference list for the given key

getPartitionList

java.util.List<java.lang.Integer> getPartitionList(byte[] key)
Get the partition list for the given key. TODO: The naming of this method is confusing.. it is simply a wrapper around getReplicatingPartitionList(int) that takes a key. So, would be good to rename this also as getReplicatingPartitionList

Parameters:
key - The key the operation is operating on
Returns:
The partition list for the given key

getMasterPartition

java.lang.Integer getMasterPartition(byte[] key)
Obtain the master partition for a given key

Parameters:
key - The key being operated on
Returns:
The partition that owns the key

getReplicatingPartitionList

java.util.List<java.lang.Integer> getReplicatingPartitionList(int partitionId)
Get the replication partitions list for the given partition.

Parameters:
partitionId -
Returns:
The List of partitionId where this partition is replicated.

getNodes

java.util.Set<Node> getNodes()
Get the collection of nodes that are candidates for routing.

Returns:
The collection of nodes

getNumReplicas

int getNumReplicas()
Return the number of replicas

Returns:
The number of replicas


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu