leslizhang commented on code in PR #1670:
URL: 
https://github.com/apache/incubator-uniffle/pull/1670#discussion_r1597454240


##########
client-spark/common/src/main/java/org/apache/spark/shuffle/writer/WriteBufferManager.java:
##########
@@ -292,20 +299,34 @@ public List<ShuffleBlockInfo> addRecord(int partitionId, 
Object key, Object valu
   }
 
   // transform all [partition, records] to [partition, ShuffleBlockInfo] and 
clear cache
-  public synchronized List<ShuffleBlockInfo> clear() {
+  public synchronized List<ShuffleBlockInfo> clear(double bufferSpillRatio) {
     List<ShuffleBlockInfo> result = Lists.newArrayList();
     long dataSize = 0;
     long memoryUsed = 0;
-    Iterator<Entry<Integer, WriterBuffer>> iterator = 
buffers.entrySet().iterator();
-    while (iterator.hasNext()) {
-      Entry<Integer, WriterBuffer> entry = iterator.next();
-      WriterBuffer wb = entry.getValue();
+    bufferSpillRatio = Math.max(0.1, Math.min(1.0, bufferSpillRatio));
+    List<Integer> partitionList = new ArrayList(buffers.keySet());
+    if (bufferSpillRatio < 1.0) {

Review Comment:
   done



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