pnowojski commented on a change in pull request #8476: [FLINK-12490][network] 
Introduce Input and NetworkInput interfaces
URL: https://github.com/apache/flink/pull/8476#discussion_r286479556
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/StreamInputProcessor.java
 ##########
 @@ -156,9 +129,41 @@ public StreamInputProcessor(
        }
 
        public boolean processInput() throws Exception {
-               if (isFinished) {
-                       return false;
+               initializeNumRecordsIn();
+
+               StreamElement recordOrMark = input.pollNext();
+               if (recordOrMark == null) {
+                       input.isAvailable().get();
+                       return input.isFinished();
                }
+
+               processElement(recordOrMark);
+               return true;
+       }
+
+       private void processElement(StreamElement recordOrMark) throws 
Exception {
+               if (recordOrMark.isWatermark()) {
+                       // handle watermark
+                       
statusWatermarkValve.inputWatermark(recordOrMark.asWatermark(), currentChannel);
 
 Review comment:
   True, there was a bug. However I'm not sure if we should squeeze more 
functionality to the `NetworkInput`. As it is now, it's a pretty small and nice 
class, that has a single responsibility - deserializing records, it would be 
nice to keep it as that. 
   
   I was actually thinking about maybe latter adding another wrapper class, 
that would wrap `Input` and encapsulate watermark handling? 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to