xumanbu commented on code in PR #1610:
URL: 
https://github.com/apache/incubator-uniffle/pull/1610#discussion_r1544332864


##########
client-spark/common/src/main/java/org/apache/spark/shuffle/writer/AddBlockEvent.java:
##########
@@ -59,6 +59,23 @@ public List<Runnable> getProcessedCallbackChain() {
     return processedCallbackChain;
   }
 
+  public void withBlockProcessedCallback(
+      TupleConsumer<ShuffleBlockInfo, Boolean> blockProcessedCallback) {
+    this.blockProcessedCallback = blockProcessedCallback;
+  }
+
+  public TupleConsumer<ShuffleBlockInfo, Boolean> getBlockProcessedCallback() {
+    return blockProcessedCallback;
+  }
+
+  public void enableBlockResend() {

Review Comment:
   Should the `isResendEnabled` be set to `isBlockFailSentRetryEnabled`?



##########
client-spark/common/src/main/java/org/apache/spark/shuffle/writer/WriteBufferManager.java:
##########
@@ -427,20 +425,16 @@ public List<AddBlockEvent> 
buildBlockEvents(List<ShuffleBlockInfo> shuffleBlockI
                   + totalSize
                   + " bytes");
         }
-        // Use final temporary variables for closures
-        final long memoryUsedTemp = memoryUsed;
-        final List<ShuffleBlockInfo> shuffleBlocksTemp = 
shuffleBlockInfosPerEvent;
         events.add(
             new AddBlockEvent(
                 taskId,
                 shuffleBlockInfosPerEvent,
-                () -> {
-                  freeAllocatedMemory(memoryUsedTemp);
-                  shuffleBlocksTemp.stream().forEach(x -> 
x.getData().release());
+                (block, isSuccessful) -> {
+                  this.freeAllocatedMemory(block.getFreeMemory());

Review Comment:
   free memory logic may check if `isSuccessful` is true?



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