voldemort.client.protocol.admin
Class AdminClient.RebalancingOperations

java.lang.Object
  extended by voldemort.client.protocol.admin.AdminClient.RebalancingOperations
Enclosing class:
AdminClient

public class AdminClient.RebalancingOperations
extends java.lang.Object

Encapsulates all operations concerning cluster expansion


Constructor Summary
AdminClient.RebalancingOperations()
           
 
Method Summary
 void deleteStoreRebalanceState(int donorNodeId, int stealerNodeId, java.lang.String storeName)
          Delete the rebalancing metadata related to the store on the stealer node
 Versioned<RebalancerState> getRemoteRebalancerState(int nodeId)
          Return the remote rebalancer state for remote node
 Versioned<MetadataStore.VoldemortState> getRemoteServerState(int nodeId)
          Retrieve the server MetadataStore.VoldemortState from a remote node.
 int rebalanceNode(java.util.List<RebalancePartitionsInfo> stealInfos)
          Rebalance a stealer-donor node pair for a set of stores.
 int rebalanceNode(RebalancePartitionsInfo stealInfo)
          Rebalance a stealer-donor node pair for a set of stores.
 void rebalanceStateChange(Cluster existingCluster, Cluster transitionCluster, java.util.List<RebalancePartitionsInfo> rebalancePartitionPlanList, boolean swapRO, boolean changeClusterMetadata, boolean changeRebalanceState, boolean rollback, boolean failEarly)
          Used in rebalancing to indicate change in states.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminClient.RebalancingOperations

public AdminClient.RebalancingOperations()
Method Detail

rebalanceNode

public int rebalanceNode(java.util.List<RebalancePartitionsInfo> stealInfos)
Rebalance a stealer-donor node pair for a set of stores. This is run on the donor node.

Parameters:
stealInfos - List of partition steal information
Returns:
The request id of the async operation

rebalanceNode

public int rebalanceNode(RebalancePartitionsInfo stealInfo)
Rebalance a stealer-donor node pair for a set of stores. This is run on the stealer node.

Parameters:
stealInfo - Partition steal information
Returns:
The request id of the async operation

deleteStoreRebalanceState

public void deleteStoreRebalanceState(int donorNodeId,
                                      int stealerNodeId,
                                      java.lang.String storeName)
Delete the rebalancing metadata related to the store on the stealer node

Parameters:
donorNodeId - The donor node id
stealerNodeId - The stealer node id
storeName - The name of the store

getRemoteServerState

public Versioned<MetadataStore.VoldemortState> getRemoteServerState(int nodeId)
Retrieve the server MetadataStore.VoldemortState from a remote node.

Parameters:
nodeId - The node from which we want to retrieve the state
Returns:
The server state

getRemoteRebalancerState

public Versioned<RebalancerState> getRemoteRebalancerState(int nodeId)
Return the remote rebalancer state for remote node

Parameters:
nodeId - Node id
Returns:
The rebalancer state

rebalanceStateChange

public void rebalanceStateChange(Cluster existingCluster,
                                 Cluster transitionCluster,
                                 java.util.List<RebalancePartitionsInfo> rebalancePartitionPlanList,
                                 boolean swapRO,
                                 boolean changeClusterMetadata,
                                 boolean changeRebalanceState,
                                 boolean rollback,
                                 boolean failEarly)
Used in rebalancing to indicate change in states. Groups the partition plans on the basis of stealer nodes and sends them over. The various combinations and their order of execution is given below
 | swapRO | changeClusterMetadata | changeRebalanceState | Order |
 | f | t | t | cluster -> rebalance | 
 | f | f | t | rebalance |
 | t | t | f | cluster -> swap |
 | t | t | t | cluster -> swap -> rebalance |
 
Similarly for rollback:
 | swapRO | changeClusterMetadata | changeRebalanceState | Order |
 | f | t | t | remove from rebalance -> cluster  | 
 | f | f | t | remove from rebalance |
 | t | t | f | cluster -> swap |
 | t | t | t | remove from rebalance -> cluster -> swap  |
 

Parameters:
existingCluster - Current cluster
transitionCluster - Transition cluster
rebalancePartitionPlanList - The list of rebalance partition info plans
swapRO - Boolean indicating if we need to swap RO stores
changeClusterMetadata - Boolean indicating if we need to change cluster metadata
changeRebalanceState - Boolean indicating if we need to change rebalancing state
rollback - Do we want to do a rollback step in case of failures?
failEarly - Do we want to fail early while doing state change?


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