tweise commented on code in PR #20530:
URL: https://github.com/apache/flink/pull/20530#discussion_r943590580


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/SwitchedSources.java:
##########
@@ -45,4 +47,14 @@ public SimpleVersionedSerializer<SourceSplit> 
serializerOf(int sourceIndex) {
     public void put(int sourceIndex, Source source) {
         sources.put(sourceIndex, Preconditions.checkNotNull(source));
     }
+
+    public Integer getSourceIndex(int subtaskSourceIndex) {
+        Integer integer = sources.firstKey();

Review Comment:
   Note that in the -1 case, the index should be `sources.firstKey()`, not 
`sources.firstKey() - 1`



##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/SwitchedSources.java:
##########
@@ -45,4 +47,14 @@ public SimpleVersionedSerializer<SourceSplit> 
serializerOf(int sourceIndex) {
     public void put(int sourceIndex, Source source) {
         sources.put(sourceIndex, Preconditions.checkNotNull(source));
     }
+
+    public Integer getSourceIndex(int subtaskSourceIndex) {
+        Integer integer = sources.firstKey();

Review Comment:
   Note that for the -1 case, the index should be `sources.firstKey()`, not 
`sources.firstKey() - 1`



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to