curcur commented on a change in pull request #13501:
URL: https://github.com/apache/flink/pull/13501#discussion_r497225512
##########
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:
Yeah, I was also thinking of that. The problem is that I have to change
all the common methods in the superclass that uses `parent` to
`approximateParent` => a lot of redundant code.
`releaseView()` is one of the few classes that are different from the
superclass.
----------------------------------------------------------------
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:
[email protected]