mas-chen commented on code in PR #20215:
URL: https://github.com/apache/flink/pull/20215#discussion_r960134253


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSourceReader.java:
##########
@@ -231,16 +236,7 @@ private void setCurrentReader(int index) {
         reader.start();
         currentSourceIndex = index;
         currentReader = reader;
-        currentReader
-                .isAvailable()
-                .whenComplete(
-                        (result, ex) -> {
-                            if (ex == null) {
-                                availabilityFuture.complete(result);
-                            } else {
-                                availabilityFuture.completeExceptionally(ex);
-                            }
-                        });

Review Comment:
   Makes sense. We only really deal with one future here at a time, so I agree 
that the helper class adds more complexity than necessary. I worked on 
integrating your idea and enhanced the unit test. 
   
   However, I did not include lines 98-102 
(https://github.com/apache/flink/compare/master...mxm:flink:FLINK-27479?expand=1#diff-2a9fc4178aac9e00bad9d172c1011d50a2ecd17ada6ca6260db40728bb978723R98-R102).
 The underlying reader should not complete it's underlying future if it is 
reporting 'END_OF_INPUT'



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

Reply via email to