voldemort.client.rebalance
Class RebalancePlan
java.lang.Object
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
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 defsfinalCluster
- desired deployed clusterfinalStoreDefs
- desired deployed store defsbatchSize
- 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)
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