curcur commented on a change in pull request #13501:
URL: https://github.com/apache/flink/pull/13501#discussion_r498892692



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/PipelinedApproximateSubpartitionView.java
##########
@@ -0,0 +1,27 @@
+package org.apache.flink.runtime.io.network.partition;
+
+import static org.apache.flink.util.Preconditions.checkState;
+
+public class PipelinedApproximateSubpartitionView extends 
PipelinedSubpartitionView {
+
+       PipelinedApproximateSubpartitionView(PipelinedApproximateSubpartition 
parent, BufferAvailabilityListener listener) {
+               super(parent, listener);
+       }
+
+       @Override
+       public void releaseAllResources() {
+               if (isReleased.compareAndSet(false, true)) {
+                       // The view doesn't hold any resources and the parent 
cannot be restarted. Therefore,
+                       // it's OK to notify about consumption as well.
+                       checkState(parent instanceof 
PipelinedApproximateSubpartition);
+                       ((PipelinedApproximateSubpartition) 
parent).releaseView();
+               }
+       }

Review comment:
       PipelinedSubpartitionView#releaseAllResources
   ```
           @Override
        public void releaseAllResources() {
                if (isReleased.compareAndSet(false, true)) {
                        // The view doesn't hold any resources and the parent 
cannot be restarted. Therefore,
                        // it's OK to notify about consumption as well.
                        parent.onConsumedSubpartition();
                }
        }
   ```
   
   They are different in the sense that `PipelinedSubpartitionView` release the 
subPartition => Partition as well
   `PipelinedApproximateSubpartition` only releases view.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to