pnowojski commented on a change in pull request #11877: URL: https://github.com/apache/flink/pull/11877#discussion_r665895504
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BoundedBlockingSubpartitionDirectTransferReader.java ########## @@ -91,10 +91,14 @@ public BufferAndBacklog getNextBuffer() throws IOException { updateStatistics(current); - // We simply assume all the data are non-events for batch jobs to avoid pre-fetching the - // next header - Buffer.DataType nextDataType = - numDataAndEventBuffers > 0 ? Buffer.DataType.DATA_BUFFER : Buffer.DataType.NONE; + // We simply assume all the data except for the last one (EndOfPartitionEvent) + // are non-events for batch jobs to avoid pre-fetching the next header + Buffer.DataType nextDataType = Buffer.DataType.NONE; + if (numDataBuffers > 0) { + nextDataType = Buffer.DataType.DATA_BUFFER; + } else if (numDataAndEventBuffers > 0) { + nextDataType = Buffer.DataType.EVENT_BUFFER; + } Review comment: Let's stay with the option 2 (as you have currently implemented) -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org