summaryzb commented on code in PR #1260:
URL: 
https://github.com/apache/incubator-uniffle/pull/1260#discussion_r1369773294


##########
client/src/main/java/org/apache/uniffle/client/impl/ShuffleWriteClientImpl.java:
##########
@@ -355,16 +354,36 @@ public SendShuffleDataResult sendShuffleData(
       }
     }
     /** Records the ShuffleServer that successfully or failed to send blocks */
-    Map<Long, List<ShuffleServerInfo>> blockIdSendSuccessTracker = 
JavaUtils.newConcurrentMap();
-    Map<Long, List<ShuffleServerInfo>> blockIdsSendFailTracker = 
JavaUtils.newConcurrentMap();
+    // we assume that most of the blocks can be sent successfully
+    // so initialize the map at first without concurrency insurance
+    // AtomicInteger is enough to reflect value changes in other threads
+    Map<Long, AtomicInteger> blockIdsSendSuccessTracker = Maps.newHashMap();

Review Comment:
   Instead of put the blockId in `blockIdsSendSuccessTracker` when get a 
response in multi threads, We just put all blockIds in the beginning before 
concurrency execute. This is helpful to reduce condition race,  and we can be 
optimistically that no space will be wasted since  most of the blockIds will be 
sent successfully.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to