1u0 commented on a change in pull request #9478: [FLINK-13766][task] Refactor the implementation of StreamInputProcessor based on StreamTaskInput#emitNext URL: https://github.com/apache/flink/pull/9478#discussion_r321697882
########## File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/StreamTaskNetworkInput.java ########## @@ -125,15 +142,31 @@ public StreamElement pollNextNullable() throws Exception { if (!checkpointedInputGate.isEmpty()) { throw new IllegalStateException("Trailing data in checkpoint barrier handler."); } + return InputStatus.END_OF_INPUT; } - return null; + return InputStatus.NOTHING_AVAILABLE; } } } + private void processElement(StreamElement recordOrMark, DataOutput<T> output) throws Exception { + if (recordOrMark.isWatermark()) { + statusWatermarkValve.inputWatermark(recordOrMark.asWatermark(), lastChannel); + } else if (recordOrMark.isStreamStatus()) { + statusWatermarkValve.inputStreamStatus(recordOrMark.asStreamStatus(), lastChannel); + } else if (recordOrMark.isRecord()){ Review comment: Suggestion: move this `if` clause to the top (as before) as potentially the most frequent case. ---------------------------------------------------------------- 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 With regards, Apache Git Services