Package org.infinispan.topology

Examples of org.infinispan.topology.DefaultRebalancePolicy


      addClusterEnabledCacheManager(cacheConfigBuilder);
      waitForClusterToForm();

      TestingUtil.replaceComponent(manager(0), RebalancePolicy.class,
            new DefaultRebalancePolicy() {
               @Override
               public void updateCacheStatus(String cacheName, ClusterCacheStatus cacheStatus) throws Exception {
                  if (cacheStatus.getCacheTopology().getPendingCH() != null) {
                     // block the rebalance until the test reaches the desired spot
                     try {
View Full Code Here


      for (Cache c : caches) {
         if (c instanceof SecureCacheImpl) {
            c = (Cache) extractField(SecureCacheImpl.class, c, "delegate");
         }
         StateTransferManager stateTransferManager = extractComponent(c, StateTransferManager.class);
         DefaultRebalancePolicy rebalancePolicy = (DefaultRebalancePolicy) TestingUtil.extractGlobalComponent(c.getCacheManager(), RebalancePolicy.class);
         Address cacheAddress = c.getAdvancedCache().getRpcManager().getAddress();
         while (true) {
            CacheTopology cacheTopology = stateTransferManager.getCacheTopology();
            boolean rebalanceInProgress = stateTransferManager.isStateTransferInProgress();
            boolean chIsBalanced = !rebalanceInProgress && rebalancePolicy.isBalanced(cacheTopology.getCurrentCH());
            boolean chContainsAllMembers = cacheTopology.getCurrentCH().getMembers().size() == caches.length;
            if (chIsBalanced && chContainsAllMembers)
               break;

            if (System.nanoTime() > giveup) {
View Full Code Here

TOP

Related Classes of org.infinispan.topology.DefaultRebalancePolicy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.