|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvoldemort.server.rebalance.Rebalancer
public class Rebalancer
Service responsible for rebalancing
Handles two scenarios a) When a new request comes in b) When a rebalancing
was shut down and the box was restarted
| Constructor Summary | |
|---|---|
Rebalancer(StoreRepository storeRepository,
MetadataStore metadataStore,
VoldemortConfig voldemortConfig,
AsyncOperationService asyncService)
|
|
| Method Summary | |
|---|---|
boolean |
acquireRebalancingPermit(int nodeId)
Acquire a permit for a particular node id so as to allow rebalancing |
AsyncOperationService |
getAsyncOperationService()
|
int |
rebalanceNode(RebalancePartitionsInfo stealInfo)
This function is responsible for starting the actual async rebalance operation We also assume that the check that this server is in rebalancing state has been done at a higher level |
void |
rebalanceStateChange(Cluster cluster,
java.util.List<RebalancePartitionsInfo> rebalancePartitionsInfo,
boolean swapRO,
boolean changeClusterMetadata,
boolean changeRebalanceState,
boolean rollback)
Support four different stages For normal operation: |
void |
releaseRebalancingPermit(int nodeId)
Release the rebalancing permit for a particular node id |
void |
run()
This is called only once at startup |
void |
start()
|
void |
stop()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Rebalancer(StoreRepository storeRepository,
MetadataStore metadataStore,
VoldemortConfig voldemortConfig,
AsyncOperationService asyncService)
| Method Detail |
|---|
public AsyncOperationService getAsyncOperationService()
public void start()
public void stop()
public void run()
run in interface java.lang.Runnablepublic boolean acquireRebalancingPermit(int nodeId)
nodeId - The id of the node for which we are acquiring a permit
public void releaseRebalancingPermit(int nodeId)
nodeId - The node id whose permit we want to release
public void rebalanceStateChange(Cluster cluster,
java.util.List<RebalancePartitionsInfo> rebalancePartitionsInfo,
boolean swapRO,
boolean changeClusterMetadata,
boolean changeRebalanceState,
boolean rollback)
| swapRO | changeClusterMetadata | changeRebalanceState | Order | | f | t | t | cluster -> rebalance | | f | f | t | rebalance | | t | t | f | cluster -> swap | | t | t | t | cluster -> swap -> rebalance |In general we need to do [ cluster change -> swap -> rebalance state change ]
cluster - Cluster metadata to changerebalancePartitionsInfo - List of rebalance partitions infoswapRO - Boolean to indicate swapping of RO storechangeClusterMetadata - Boolean to indicate a change of cluster
metadatachangeRebalanceState - Boolean to indicate a change in rebalance
staterollback - Boolean to indicate that we are rolling back or notpublic int rebalanceNode(RebalancePartitionsInfo stealInfo)
stealInfo - Partition info to steal
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||