Examples of locateOwnersForSegment()


Examples of org.infinispan.distribution.ch.ConsistentHash.locateOwnersForSegment()

            // this topology update. We can't actually differentiate between L1 entries and regular entries,
            // so we delete all entries that don't belong to this node in the current OR previous topology.
            Set<Integer> invalidL1Segments = new HashSet<Integer>();
            for (int segment = 0; segment < cacheTopology.getCurrentCH().getNumSegments(); segment++) {
               if (!previousSegments.contains(segment) && newSegments.contains(segment)) {
                  List<Address> previousOwners = previousCh.locateOwnersForSegment(segment);
                  List<Address> newOwners = cacheTopology.getWriteConsistentHash().locateOwnersForSegment(segment);
                  if (!newOwners.containsAll(previousOwners)) {
                     invalidL1Segments.add(segment);
                  }
               }
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locateOwnersForSegment()

            boolean rebalanceInProgress = cacheTopology.getPendingCH() != null;
            boolean chContainsAllMembers = currentCH.getMembers().size() == caches.length;
            boolean currentChIsBalanced = true;
            int actualNumOwners = Math.min(currentCH.getNumOwners(), currentCH.getMembers().size());
            for (int i = 0; i < currentCH.getNumSegments(); i++) {
               if (currentCH.locateOwnersForSegment(i).size() < actualNumOwners) {
                  currentChIsBalanced = false;
                  break;
               }
            }
            if (chContainsAllMembers && !rebalanceInProgress && currentChIsBalanced)
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locateOwnersForSegment()

      CacheContainer cm4 = c4.getCacheManager();

      Set<Integer> overlappingSegments = new HashSet<Integer>();
      ConsistentHash ch = getConsistentHash(c1);
      for (int segment = 0; segment < ch.getNumSegments(); segment++) {
         List<Address> owners = ch.locateOwnersForSegment(segment);
         if (owners.containsAll(killedNodes)) {
            overlappingSegments.add(segment);
         }
      }
      lostSegments = overlappingSegments;
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locateOwnersForSegment()

      TestingUtil.waitForRehashToComplete(cache(0), cache(1), cache(2), cache(3));
      assertNull(stm0.getCacheTopology().getPendingCH());
      ConsistentHash ch = stm0.getCacheTopology().getCurrentCH();
      assertEquals(Arrays.asList(address(0), address(1), address(2), address(3)), ch.getMembers());
      for (int i = 0; i < ch.getNumSegments(); i++) {
         assertEquals(2, ch.locateOwnersForSegment(i).size());
      }

      // Suspend rebalancing again
      mBeanServer.setAttribute(ltmName1, new Attribute("RebalancingEnabled", false));
      assertFalse((Boolean) mBeanServer.getAttribute(ltmName0, "RebalancingEnabled"));
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locateOwnersForSegment()

      StateTransferManager stm2 = TestingUtil.extractComponent(cache(2), StateTransferManager.class);
      assertNull(stm2.getCacheTopology().getPendingCH());
      ch = stm2.getCacheTopology().getCurrentCH();
      assertEquals(Arrays.asList(address(2), address(3)), ch.getMembers());
      for (int i = 0; i < ch.getNumSegments(); i++) {
         assertEquals(1, ch.locateOwnersForSegment(i).size());
      }

      // Enable rebalancing again
      log.debugf("Rebalancing with nodes %s %s", address(2), address(3));
      String domain2 = manager(2).getCacheManagerConfiguration().globalJmxStatistics().domain();
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locateOwnersForSegment()

      TestingUtil.waitForRehashToComplete(cache(2), cache(3));
      assertNull(stm2.getCacheTopology().getPendingCH());
      ch = stm2.getCacheTopology().getCurrentCH();
      assertEquals(Arrays.asList(address(2), address(3)), ch.getMembers());
      for (int i = 0; i < ch.getNumSegments(); i++) {
         assertEquals(2, ch.locateOwnersForSegment(i).size());
      }
   }
}
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locateOwnersForSegment()

            boolean rebalanceInProgress = cacheTopology.getPendingCH() != null;
            boolean chContainsAllMembers = currentCH.getMembers().size() == caches.length;
            boolean currentChIsBalanced = true;
            int actualNumOwners = Math.min(currentCH.getNumOwners(), currentCH.getMembers().size());
            for (int i = 0; i < currentCH.getNumSegments(); i++) {
               if (currentCH.locateOwnersForSegment(i).size() < actualNumOwners) {
                  currentChIsBalanced = false;
                  break;
               }
            }
            if (chContainsAllMembers && !rebalanceInProgress && currentChIsBalanced)
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locateOwnersForSegment()

      CacheContainer cm4 = c4.getCacheManager();

      Set<Integer> overlappingSegments = new HashSet<Integer>();
      ConsistentHash ch = getConsistentHash(c1);
      for (int segment = 0; segment < ch.getNumSegments(); segment++) {
         List<Address> owners = ch.locateOwnersForSegment(segment);
         if (owners.containsAll(killedNodes)) {
            overlappingSegments.add(segment);
         }
      }
      lostSegments = overlappingSegments;
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locateOwnersForSegment()

      TestingUtil.waitForRehashToComplete(cache(0), cache(1), cache(2), cache(3));
      assertNull(stm0.getCacheTopology().getPendingCH());
      ConsistentHash ch = stm0.getCacheTopology().getCurrentCH();
      assertEquals(Arrays.asList(address(0), address(1), address(2), address(3)), ch.getMembers());
      for (int i = 0; i < ch.getNumSegments(); i++) {
         assertEquals(2, ch.locateOwnersForSegment(i).size());
      }

      // Suspend rebalancing again
      mBeanServer.setAttribute(ltmName1, new Attribute("RebalancingEnabled", false));
      assertFalse((Boolean) mBeanServer.getAttribute(ltmName0, "RebalancingEnabled"));
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locateOwnersForSegment()

      StateTransferManager stm2 = TestingUtil.extractComponent(cache(2), StateTransferManager.class);
      assertNull(stm2.getCacheTopology().getPendingCH());
      ch = stm2.getCacheTopology().getCurrentCH();
      assertEquals(Arrays.asList(address(2), address(3)), ch.getMembers());
      for (int i = 0; i < ch.getNumSegments(); i++) {
         assertEquals(1, ch.locateOwnersForSegment(i).size());
      }

      // Enable rebalancing again
      log.debugf("Rebalancing with nodes %s %s", address(2), address(3));
      String domain2 = manager(2).getCacheManagerConfiguration().globalJmxStatistics().domain();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.