voldemort.client.rebalance
Class RebalancePlan

java.lang.Object
  extended by voldemort.client.rebalance.RebalancePlan

public class RebalancePlan
extends java.lang.Object

RebalancePlan encapsulates all aspects of planning a shuffle, cluster expansion, or zone expansion.


Field Summary
static int BATCH_SIZE
          The number of "primary" partition IDs to move in each batch of the plan.
 
Constructor Summary
RebalancePlan(Cluster currentCluster, java.util.List<StoreDefinition> currentStores, Cluster finalCluster, int batchSize, java.lang.String outputDir)
           
RebalancePlan(Cluster currentCluster, java.util.List<StoreDefinition> currentStoreDefs, Cluster finalCluster, java.util.List<StoreDefinition> finalStoreDefs, int batchSize, java.lang.String outputDir)
          Constructs a plan for the specified change from currentCluster/StoreDefs to finalCluster/StoreDefs.
 
Method Summary
 Cluster getCurrentCluster()
           
 java.util.List<StoreDefinition> getCurrentStores()
           
 Cluster getFinalCluster()
           
 java.util.List<StoreDefinition> getFinalStores()
           
 MoveMap getNodeMoveMap()
           
 int getPartitionStoresMoved()
           
 int getPartitionStoresMovedXZone()
           
 java.util.List<RebalanceBatchPlan> getPlan()
           
 int getPrimariesMoved()
           
 MoveMap getZoneMoveMap()
           
 int taskCount()
          Total number of rebalancing tasks in the plan.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BATCH_SIZE

public static final int BATCH_SIZE
The number of "primary" partition IDs to move in each batch of the plan. Moving a primary partition ID between nodes results in between zero and (# of zones) * (2) * (# stores) partition-stores being moved. The (2) comes from an upper bound of a single move affecting two-nodes per zone.

See Also:
Constant Field Values
Constructor Detail

RebalancePlan

public RebalancePlan(Cluster currentCluster,
                     java.util.List<StoreDefinition> currentStoreDefs,
                     Cluster finalCluster,
                     java.util.List<StoreDefinition> finalStoreDefs,
                     int batchSize,
                     java.lang.String outputDir)
Constructs a plan for the specified change from currentCluster/StoreDefs to finalCluster/StoreDefs. finalStoreDefs are needed for the zone expansion use case since store definitions depend on the number of zones. In theory, since current & final StoreDefs are passed in, this plan could be used to transform deployed store definitions. In practice, this use case has not been tested.

Parameters:
currentCluster - current deployed cluster.
currentStoreDefs - current deployed store defs
finalCluster - desired deployed cluster
finalStoreDefs - desired deployed store defs
batchSize - number of primary partitions to move in each batch.
outputDir - directory in which to dump metadata files for the plan

RebalancePlan

public RebalancePlan(Cluster currentCluster,
                     java.util.List<StoreDefinition> currentStores,
                     Cluster finalCluster,
                     int batchSize,
                     java.lang.String outputDir)
Method Detail

getCurrentCluster

public Cluster getCurrentCluster()

getCurrentStores

public java.util.List<StoreDefinition> getCurrentStores()

getFinalCluster

public Cluster getFinalCluster()

getFinalStores

public java.util.List<StoreDefinition> getFinalStores()

getPlan

public java.util.List<RebalanceBatchPlan> getPlan()
Returns:
The plan!

taskCount

public int taskCount()
Total number of rebalancing tasks in the plan.

Returns:
number of rebalancing tasks in the plan.

getPrimariesMoved

public int getPrimariesMoved()

getPartitionStoresMoved

public int getPartitionStoresMoved()

getPartitionStoresMovedXZone

public int getPartitionStoresMovedXZone()

getNodeMoveMap

public MoveMap getNodeMoveMap()

getZoneMoveMap

public MoveMap getZoneMoveMap()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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