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
RebalancePolicy
initCache
in interface RebalancePolicy
Exception
public void updateCacheStatus(String cacheName, ClusterCacheStatus cacheStatus) throws Exception
RebalancePolicy
updateCacheStatus
in interface RebalancePolicy
Exception
public boolean isBalanced(ConsistentHash ch)
public boolean isRebalancingEnabled()
isRebalancingEnabled
in interface RebalancePolicy
true
if rebalancing is allowed, false
if rebalancing is suspended.public void setRebalancingEnabled(boolean enabled)
setRebalancingEnabled
in interface RebalancePolicy
enabled
- 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.