vldpyatkov commented on code in PR #2141:
URL: https://github.com/apache/ignite-3/pull/2141#discussion_r1252689832


##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/LeaseUpdater.java:
##########
@@ -263,6 +282,14 @@ public void run() {
             while (updaterTread != null && !updaterTread.isInterrupted()) {
                 long outdatedLeaseThreshold = clock.now().getPhysical() + 
LEASE_INTERVAL / 2;
 
+                IgniteBiTuple<NavigableMap<ReplicationGroupId, Lease>, byte[]> 
leasesCurrent = leaseTracker.leasesCurrent();
+                Map<ReplicationGroupId, Boolean> toBeNegotiated = new 
HashMap<>();
+                NavigableMap<ReplicationGroupId, Lease> renewedLeases = new 
TreeMap<>(Comparator.comparing(Object::toString));
+
+                for (Lease lease : leasesCurrent.getKey().values()) {
+                    renewedLeases.put(lease.replicationGroupId(), lease);
+                }

Review Comment:
   Does it possible to replace `new TreeMap(leasesCurrent)`?



##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/LeaseUpdater.java:
##########
@@ -263,6 +282,14 @@ public void run() {
             while (updaterTread != null && !updaterTread.isInterrupted()) {
                 long outdatedLeaseThreshold = clock.now().getPhysical() + 
LEASE_INTERVAL / 2;
 
+                IgniteBiTuple<NavigableMap<ReplicationGroupId, Lease>, byte[]> 
leasesCurrent = leaseTracker.leasesCurrent();
+                Map<ReplicationGroupId, Boolean> toBeNegotiated = new 
HashMap<>();
+                NavigableMap<ReplicationGroupId, Lease> renewedLeases = new 
TreeMap<>(Comparator.comparing(Object::toString));

Review Comment:
   I am not sure the order of the map is so important.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to