Github user NicoK commented on a diff in the pull request:
https://github.com/apache/flink/pull/4559#discussion_r154343587
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultSubpartitionView.java
---
@@ -22,32 +22,57 @@
import java.io.IOException;
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
/**
* A view to consume a {@link ResultSubpartition} instance.
*/
-public interface ResultSubpartitionView {
+public abstract class ResultSubpartitionView {
+
+ /** The parent subpartition this view belongs to. */
+ private final ResultSubpartition parent;
+
+ public ResultSubpartitionView(ResultSubpartition parent) {
+ this.parent = checkNotNull(parent);
+ }
+
+ /**
+ * Returns the next {@link Buffer} instance of this queue iterator and
also
+ * decreases the related statistics.
+ */
+ public Buffer getNextBuffer() throws IOException, InterruptedException {
--- End diff --
`@Nullable` and (I'm not sure whether @pnowojski agrees) maybe make this
method `final` (any subclass should only override `getNextBufferInternal`)?
---