reswqa commented on code in PR #20371:
URL: https://github.com/apache/flink/pull/20371#discussion_r931131847


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsSubpartitionMemoryDataManager.java:
##########
@@ -252,6 +252,20 @@ public void 
releaseSubpartitionBuffers(List<BufferIndexAndChannel> toRelease) {
                                 }));
     }
 
+    @SuppressWarnings("FieldAccessNotGuarded")
+    // Note that: runWithLock ensure that code block guarded by 
resultPartitionReadLock and
+    // subpartitionLock.
+    public void release() {
+        runWithLock(
+                () -> {
+                    // clear all buffer of this subpartition to help gc, 
memorySegments should
+                    // recycle to buffer pool after spilled.
+                    unfinishedBuffers.clear();
+                    allBuffers.clear();
+                    unConsumedBuffers.clear();

Review Comment:
   removed.



##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsSubpartitionMemoryDataManager.java:
##########
@@ -252,6 +252,20 @@ public void 
releaseSubpartitionBuffers(List<BufferIndexAndChannel> toRelease) {
                                 }));
     }
 
+    @SuppressWarnings("FieldAccessNotGuarded")
+    // Note that: runWithLock ensure that code block guarded by 
resultPartitionReadLock and
+    // subpartitionLock.
+    public void release() {
+        runWithLock(
+                () -> {
+                    // clear all buffer of this subpartition to help gc, 
memorySegments should
+                    // recycle to buffer pool after spilled.
+                    unfinishedBuffers.clear();
+                    allBuffers.clear();
+                    unConsumedBuffers.clear();

Review Comment:
   Removed.



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