gharris1727 commented on code in PR #18098:
URL: https://github.com/apache/kafka/pull/18098#discussion_r1876755215
##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorCheckpointConnector.java:
##########
@@ -132,20 +132,23 @@ public Class<? extends Task> taskClass() {
// divide consumer groups among tasks
@Override
public List<Map<String, String>> taskConfigs(int maxTasks) {
+ if (!config.enabled()) {
+ return Collections.emptyList();
+ }
+
if (knownConsumerGroups == null) {
// If knownConsumerGroup is null, it means the initial loading has
not finished.
// An exception should be thrown to trigger the retry behavior in
the framework.
log.debug("Initial consumer loading has not yet completed");
throw new RetriableException("Timeout while loading consumer
groups.");
}
- // if the replication is disabled, known consumer group is empty, or
checkpoint emission is
- // disabled by setting 'emit.checkpoints.enabled' to false, the
interval of checkpoint emission
- // will be negative and no 'MirrorCheckpointTask' will be created
- if (!config.enabled() || knownConsumerGroups.isEmpty()
- || config.emitCheckpointsInterval().isNegative()) {
+ // if known consumer group is empty, or checkpoint emission is
disabled by setting 'emit.checkpoints.enabled' to false,
+ // the interval of checkpoint emission will be negative and no
'MirrorCheckpointTask' will be created
+ if (knownConsumerGroups.isEmpty() ||
config.emitCheckpointsInterval().isNegative()) {
Review Comment:
Can you move the comment and the emitCheckpointsInterval check up to the
earlier if-condition also?
--
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]