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_r286742814
 
 

 ##########
 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:
   In fact, I care about that the input channel index is exposed to input 
processors. As long as it's not exposed to the input processor (for example, 
encapsulating a class as you said), it's fine to me.

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