xintongsong commented on code in PR #22960:
URL: https://github.com/apache/flink/pull/22960#discussion_r1258144552


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/storage/TieredStorageMemoryManagerImpl.java:
##########
@@ -276,6 +294,13 @@ private void recycleBuffer(Object owner, MemorySegment 
buffer) {
         decNumRequestedBuffer(owner);
     }
 
+    private BufferRecycler getOwnerBufferRecycler(Object owner) {
+        return memorySegment -> {
+            bufferPool.recycle(memorySegment);
+            decNumRequestedBuffer(owner);
+        };
+    }

Review Comment:
   This seems to be duplicated with `recycleBuffer`.



##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/tier/disk/DiskCacheManager.java:
##########
@@ -41,6 +41,8 @@ class DiskCacheManager {
 
     private final int numSubpartitions;
 
+    private final TieredStorageMemoryManager memoryManager;

Review Comment:
   What is the purpose of this change? The filed seems never accessed after 
initialized.



##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/storage/TieredStorageMemoryManagerImpl.java:
##########
@@ -200,6 +202,22 @@ public int numOwnerRequestedBuffer(Object owner) {
         return numRequestedBuffer == null ? 0 : numRequestedBuffer.get();
     }
 
+    @Override
+    public void transferBufferOwnership(Object oldOwner, Object newOwner, 
Buffer buffer) {
+        if (!buffer.isBuffer()) {
+            return;
+        }

Review Comment:
   What is the expected behavior when `buffer.isBuffer()` is `false`? Should it 
be allowed at all?



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