bowenli-oai commented on code in PR #240:
URL:
https://github.com/apache/flink-connector-kafka/pull/240#discussion_r2943538707
##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/dynamic/source/reader/DynamicKafkaSourceReader.java:
##########
@@ -417,6 +427,78 @@ public void notifyCheckpointComplete(long checkpointId)
throws Exception {
}
}
+ @Override
+ public void pauseOrResumeSplits(
+ Collection<String> splitsToPause, Collection<String>
splitsToResume) {
+ Map<String, List<String>> splitsToPauseByCluster =
groupSplitIdsByCluster(splitsToPause);
+ Map<String, List<String>> splitsToResumeByCluster =
groupSplitIdsByCluster(splitsToResume);
+
+ Set<String> kafkaClusterIds = new HashSet<>();
+ kafkaClusterIds.addAll(splitsToPauseByCluster.keySet());
+ kafkaClusterIds.addAll(splitsToResumeByCluster.keySet());
+
+ logger.debug(
Review Comment:
make this info level, or add another simplier log line to indicate alignment
actually kicked in?
i don't think the operator has any log lines that actually log it
##########
flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/dynamic/source/reader/DynamicKafkaSourceReaderPauseResumeTest.java:
##########
Review Comment:
by convention iirc tests should be in the class named
"<classname>Test.java", can you move tests to
DynamicKafkaSourceReaderTest.java?
##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/dynamic/source/reader/DynamicKafkaSourceReader.java:
##########
@@ -417,6 +427,78 @@ public void notifyCheckpointComplete(long checkpointId)
throws Exception {
}
}
+ @Override
+ public void pauseOrResumeSplits(
Review Comment:
tracking down the codepath, KafkaSourceReader. pauseOrResumeSplits() already
filters the requested IDs down to its assigned splits before touching the
fetcher.
thus it can be simplified like this?
```
@Override
public void pauseOrResumeSplits(
Collection<String> splitsToPause, Collection<String> splitsToResume)
{
// log a line here
for (KafkaSourceReader<T> subReader : clusterReaderMap.values()) {
subReader.pauseOrResumeSplits(splitsToPause, splitsToResume);
}
}
```
--
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]