public class DefaultRebalancePolicy extends Object implements RebalancePolicy
RebalancePolicy| Constructor and Description |
|---|
DefaultRebalancePolicy() |
| Modifier and Type | Method and Description |
|---|---|
void |
initCache(String cacheName,
ClusterCacheStatus cacheStatus)
Initialize the policy for a cache, without a list of members.
|
void |
inject(ClusterTopologyManager clusterTopologyManager) |
boolean |
isBalanced(ConsistentHash ch) |
boolean |
isRebalancingEnabled() |
void |
setRebalancingEnabled(boolean enabled) |
void |
updateCacheStatus(String cacheName,
ClusterCacheStatus cacheStatus)
Called when the status of a cache changes.
|
public void inject(ClusterTopologyManager clusterTopologyManager)
public void initCache(String cacheName, ClusterCacheStatus cacheStatus) throws Exception
RebalancePolicyinitCache in interface RebalancePolicyExceptionpublic void updateCacheStatus(String cacheName, ClusterCacheStatus cacheStatus) throws Exception
RebalancePolicyupdateCacheStatus in interface RebalancePolicyExceptionpublic boolean isBalanced(ConsistentHash ch)
public boolean isRebalancingEnabled()
isRebalancingEnabled in interface RebalancePolicytrue if rebalancing is allowed, false if rebalancing is suspended.public void setRebalancingEnabled(boolean enabled)
setRebalancingEnabled in interface RebalancePolicyenabled - true to start rebalancing (immediately starting the rebalance if necessary),
false to suspend it.Copyright © 2014 JBoss, a division of Red Hat. All rights reserved.