refactoring

pull/3083/head
Nikita Koksharov 4 years ago
parent f73eea3636
commit 1f79c80171

@ -674,10 +674,10 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager {
addedSlots.andNot(currentPartition.slots());
currentPartition.addSlots(addedSlots);
for (Integer slot : (Iterable<Integer>) addedSlots.stream()::iterator) {
addedSlots.stream().forEach(slot -> {
addEntry(slot, entry);
lastPartitions.put(slot, currentPartition);
}
});
if (!addedSlots.isEmpty()) {
log.info("{} slots added to {}", addedSlots.cardinality(), currentPartition.getMasterAddress());
}
@ -686,12 +686,11 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager {
removedSlots.andNot(newPartition.slots());
currentPartition.removeSlots(removedSlots);
for (Integer removeSlot : (Iterable<Integer>) removedSlots.stream()::iterator) {
removedSlots.stream().forEach(removeSlot -> {
if (lastPartitions.remove(removeSlot, currentPartition)) {
removeEntry(removeSlot);
}
}
});
if (!removedSlots.isEmpty()) {
log.info("{} slots removed from {}", removedSlots.cardinality(), currentPartition.getMasterAddress());
}

Loading…
Cancel
Save