Github user NicoK commented on a diff in the pull request: https://github.com/apache/flink/pull/4552#discussion_r161249082 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/SpillableSubpartitionView.java --- @@ -199,6 +199,19 @@ public boolean isReleased() { } } + @Override + public boolean nextBufferIsEvent() { + if (nextBuffer != null) { + return !nextBuffer.isBuffer(); + } --- End diff -- We probably need synchronization here to access `nextBuffer` and also check for `isReleased()` similar to `getNextBuffer`, since we are basically doing the same but without taking the buffer. Why not integrate this into `getNextBuffer` and the `BufferAndBacklog` returned there? Inside that method, gathering this additional info is basically for free and we may thus speed up some code paths.
---