org.infinispan.topology
Class DefaultRebalancePolicy
java.lang.Object
org.infinispan.topology.DefaultRebalancePolicy
- All Implemented Interfaces:
- RebalancePolicy
public class DefaultRebalancePolicy
- extends Object
- implements RebalancePolicy
Default implementation of RebalancePolicy
- Since:
- 5.2
- Author:
- Dan Berindei
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultRebalancePolicy
public DefaultRebalancePolicy()
inject
public void inject(ClusterTopologyManager clusterTopologyManager)
initCache
public void initCache(String cacheName,
ClusterCacheStatus cacheStatus)
throws Exception
- Description copied from interface:
RebalancePolicy
- Initialize the policy for a cache, without a list of members.
It won't have any effect if the cache is already initialized.
- Specified by:
initCache
in interface RebalancePolicy
- Throws:
Exception
updateCacheStatus
public void updateCacheStatus(String cacheName,
ClusterCacheStatus cacheStatus)
throws Exception
- Description copied from interface:
RebalancePolicy
- Called when the status of a cache changes. It could be a node joining or leaving, or a merge, or a
- Specified by:
updateCacheStatus
in interface RebalancePolicy
- Throws:
Exception
isBalanced
public boolean isBalanced(ConsistentHash ch)
isRebalancingEnabled
public boolean isRebalancingEnabled()
- Specified by:
isRebalancingEnabled
in interface RebalancePolicy
- Returns:
true
if rebalancing is allowed, false
if rebalancing is suspended.
setRebalancingEnabled
public void setRebalancingEnabled(boolean enabled)
- Specified by:
setRebalancingEnabled
in interface RebalancePolicy
- Parameters:
enabled
- true
to start rebalancing (immediately starting the rebalance if necessary),
false
to suspend it.
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.