dawidwys commented on a change in pull request #16589:
URL: https://github.com/apache/flink/pull/16589#discussion_r679201527
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/SourceOperator.java
##########
@@ -287,13 +292,13 @@ public DataInputStatus emitNext(DataOutput<OUT> output)
throws Exception {
// short circuit the common case (every invocation except the first)
if (currentMainOutput != null) {
- return
convertToInternalStatus(sourceReader.pollNext(currentMainOutput));
+ return
convertToInternalStatus(readingReader.pollNext(currentMainOutput));
Review comment:
My concern was adding a check on the hot path for all the records. In
order to directly return `END_OF_INPUT` I need to check the `dataFinished`
flag. Something like:
```
if (dataFinished) {
return END_OF_INPUT;
}
// short circuit the common case (every invocation except the first)
if (currentMainOutput != null) {
return
convertToInternalStatus(readingReader.pollNext(currentMainOutput));
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]