UUID nodeId = e.getKey(); for (Map.Entry<Integer, GridDhtPartitionState> e0 : e.getValue().entrySet()) { Integer p0 = e0.getKey();
/** * @param top Topology. */ private void assignPartitionSizes(GridDhtPartitionTopology top) { Map<Integer, Long> partSizes = new HashMap<>(); for (Map.Entry<UUID, GridDhtPartitionsSingleMessage> e : msgs.entrySet()) { GridDhtPartitionsSingleMessage singleMsg = e.getValue(); GridDhtPartitionMap partMap = singleMsg.partitions().get(top.groupId()); if (partMap == null) continue; for (Map.Entry<Integer, GridDhtPartitionState> e0 : partMap.entrySet()) { int p = e0.getKey(); GridDhtPartitionState state = e0.getValue(); if (state == GridDhtPartitionState.OWNING) partSizes.put(p, singleMsg.partitionSizes(top.groupId()).get(p)); } } for (GridDhtLocalPartition locPart : top.currentLocalPartitions()) { if (locPart.state() == GridDhtPartitionState.OWNING) partSizes.put(locPart.id(), locPart.fullSize()); } top.globalPartSizes(partSizes); }
for (Map.Entry<Integer, GridDhtPartitionState> stateEntry : partMap2.entrySet()) partMap1.put(stateEntry.getKey(), stateEntry.getValue());
for (Map.Entry<Integer, GridDhtPartitionState> e0 : e.getValue().entrySet()) { if (e0.getValue() != MOVING && e0.getValue() != OWNING) continue;
for (Map.Entry<Integer, GridDhtPartitionState> e0 : e.getValue().entrySet()) { if (e0.getValue() != LOST) continue;
for (Map.Entry<Integer,GridDhtPartitionState> e : parts.entrySet()) { int p = e.getKey();
@Override public void applyx() { info("Checking partition maps."); for (int i = 0; i < caches.length; i++) info("Partition map for node " + i + ": " + caches[i].topology().partitionMap(false).toFullString()); GridDhtPartitionFullMap orig = caches[0].topology().partitionMap(true); for (int i = 1; i < caches.length; i++) { GridDhtPartitionFullMap cmp = caches[i].topology().partitionMap(true); assert orig.keySet().equals(cmp.keySet()); for (Map.Entry<UUID, GridDhtPartitionMap> entry : orig.entrySet()) { UUID nodeId = entry.getKey(); GridDhtPartitionMap nodeMap = entry.getValue(); GridDhtPartitionMap cmpMap = cmp.get(nodeId); assert cmpMap != null; assert nodeMap.keySet().equals(cmpMap.keySet()); for (Map.Entry<Integer, GridDhtPartitionState> nodeEntry : nodeMap.entrySet()) { GridDhtPartitionState state = cmpMap.get(nodeEntry.getKey()); assert state != null; assert state != GridDhtPartitionState.EVICTED; assert !strict || state == GridDhtPartitionState.OWNING : "Invalid partition state: " + state; assert state == nodeEntry.getValue(); } } } } });
for (Map.Entry<Integer, GridDhtPartitionState> e : m.entrySet()) { int p = e.getKey(); GridDhtPartitionState state = e.getValue();
/** * @param grids Grids. */ private void checkActiveState(Iterable<Ignite> grids) { // Check that nodes don't have non-active information about other nodes. for (Ignite g : grids) { IgniteCache<Integer, String> c = g.cache(DEFAULT_CACHE_NAME); GridDhtCacheAdapter<Integer, String> dht = dht(c); GridDhtPartitionFullMap allParts = dht.topology().partitionMap(false); for (GridDhtPartitionMap parts : allParts.values()) { if (!parts.nodeId().equals(g.cluster().localNode().id())) { for (Map.Entry<Integer, GridDhtPartitionState> e : parts.entrySet()) { int p = e.getKey(); GridDhtPartitionState state = e.getValue(); assert state == OWNING || state == MOVING || state == RENTING : "Invalid state [igniteInstanceName=" + g.name() + ", part=" + p + ", state=" + state + ", parts=" + parts + ']'; assert state.active(); } } } } }
for (Map.Entry<Integer, GridDhtPartitionState> e : parts.entrySet()) { int p = e.getKey();
for (Map.Entry entry : pMap.entrySet()) { assertTrue("Wrong remote partition state part=" + entry.getKey() + ", should be OWNING [state=" + entry.getValue() + "], node="
break; for (Map.Entry entry : pMap.entrySet()) { if (System.currentTimeMillis() - start > timeout) { U.dumpThreads(log);
/** {@inheritDoc} */ @Override public Collection<Integer> lostPartitions() { if (grp.config().getPartitionLossPolicy() == PartitionLossPolicy.IGNORE) return Collections.emptySet(); lock.readLock().lock(); try { Set<Integer> res = null; int parts = grp.affinity().partitions(); for (GridDhtPartitionMap partMap : node2part.values()) { for (Map.Entry<Integer, GridDhtPartitionState> e : partMap.entrySet()) { if (e.getValue() == LOST) { if (res == null) res = new HashSet<>(parts); res.add(e.getKey()); } } } return res == null ? Collections.<Integer>emptySet() : res; } finally { lock.readLock().unlock(); } }
UUID nodeId = e.getKey(); for (Map.Entry<Integer, GridDhtPartitionState> e0 : e.getValue().entrySet()) { Integer p0 = e0.getKey();
/** * @param top Topology. */ private void assignPartitionSizes(GridDhtPartitionTopology top) { Map<Integer, Long> partSizes = new HashMap<>(); for (Map.Entry<UUID, GridDhtPartitionsSingleMessage> e : msgs.entrySet()) { GridDhtPartitionsSingleMessage singleMsg = e.getValue(); GridDhtPartitionMap partMap = singleMsg.partitions().get(top.groupId()); if (partMap == null) continue; for (Map.Entry<Integer, GridDhtPartitionState> e0 : partMap.entrySet()) { int p = e0.getKey(); GridDhtPartitionState state = e0.getValue(); if (state == GridDhtPartitionState.OWNING) partSizes.put(p, singleMsg.partitionSizes(top.groupId()).get(p)); } } for (GridDhtLocalPartition locPart : top.currentLocalPartitions()) { if (locPart.state() == GridDhtPartitionState.OWNING) partSizes.put(locPart.id(), locPart.fullSize()); } top.globalPartSizes(partSizes); }
for (Map.Entry<Integer, GridDhtPartitionState> e0 : e.getValue().entrySet()) { if (e0.getValue() != LOST) continue;
for (Map.Entry<Integer,GridDhtPartitionState> e : parts.entrySet()) { int p = e.getKey();
for (Map.Entry<Integer, GridDhtPartitionState> stateEntry : partMap2.entrySet()) partMap1.put(stateEntry.getKey(), stateEntry.getValue());