Improvement - CPU and Memory consumption by ClusterConnectionManager.getLastPartitonsByURI() method. #5695

pull/5706/head
Nikita Koksharov 11 months ago
parent c1c14cf6af
commit 85238b9da7

@ -346,6 +346,8 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager {
for (Integer slot : partition.getSlots()) {
addEntry(slot, entry);
lastPartitions.put(slot, partition);
}
if (partition.getSlotsAmount() > 0) {
lastUri2Partition.put(partition.getMasterAddress(), partition);
}
@ -731,10 +733,10 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager {
addedSlots.stream().forEach(slot -> {
addEntry(slot, entry);
lastPartitions.put(slot, currentPartition);
lastUri2Partition.put(currentPartition.getMasterAddress(), currentPartition);
changedSlots.add(slot);
});
if (!addedSlots.isEmpty()) {
lastUri2Partition.put(currentPartition.getMasterAddress(), currentPartition);
log.info("{} slots added to {}", addedSlots.cardinality(), currentPartition.getMasterAddress());
}

Loading…
Cancel
Save