org.infinispan.topology
Class DefaultRebalancePolicy

java.lang.Object
  extended by 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

Constructor Summary
DefaultRebalancePolicy()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRebalancePolicy

public DefaultRebalancePolicy()
Method Detail

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.