You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "cchung100m (via GitHub)" <gi...@apache.org> on 2023/06/29 02:27:13 UTC

[GitHub] [incubator-celeborn] cchung100m commented on a diff in pull request #1567: [CELEBORN-478] Replace putIfAbsent with computeIfAbsent in ConcurrentHashMap in Java code

cchung100m commented on code in PR #1567:
URL: https://github.com/apache/incubator-celeborn/pull/1567#discussion_r1246019708


##########
client/src/main/java/org/apache/celeborn/client/write/DataPushQueue.java:
##########
@@ -107,7 +107,7 @@ public ArrayList<PushTask> takePushTasks() throws IOException, InterruptedExcept
               oldCapacity = maxInFlight - pushState.inflightPushes(loc.hostAndPushPort());
               workerCapacity.put(loc.hostAndPushPort(), oldCapacity);
             }
-            workerWaitAttempts.putIfAbsent(loc.hostAndPushPort(), new AtomicInteger(0));
+            workerWaitAttempts.computeIfAbsent(loc.hostAndPushPort(), key -> new AtomicInteger(0));

Review Comment:
   Hi @waitinfuture  
   
   Thanks for the feedback and I updated the part you mentioned here.



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org