sunhaibotb 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_r285508328
 
 

 ##########
 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:
   1. It seems missing some logic about assigning value to `currentChannel` ,  
and  currently it is always - 1.
   2.  I think that the input channel index should be hidden in `NetworkInput`.

----------------------------------------------------------------
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

Reply via email to