chia7712 commented on code in PR #15999:
URL: https://github.com/apache/kafka/pull/15999#discussion_r1664751869


##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorCheckpointConfig.java:
##########
@@ -166,6 +167,30 @@ Duration consumerPollTimeout() {
         return Duration.ofMillis(getLong(CONSUMER_POLL_TIMEOUT_MILLIS));
     }
 
+    public static Map<String, String> validate(Map<String, String> configs) {
+        Map<String, String> invalidConfigs = new HashMap<>();
+
+        // No point to validate when connector is disabled.
+        if ("false".equals(configs.getOrDefault(ENABLED, "true"))) {
+            return invalidConfigs;
+        }
+
+        boolean emitCheckpointDisabled = 
"false".equals(configs.getOrDefault(EMIT_CHECKPOINTS_ENABLED, "true"));
+        boolean syncGroupOffsetsDisabled = 
"false".equals(configs.getOrDefault(SYNC_GROUP_OFFSETS_ENABLED, "true"));

Review Comment:
   the default value of `SYNC_GROUP_OFFSETS_ENABLED` is `false`, so why we 
don't use the same default value here?



##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorCheckpointConfig.java:
##########
@@ -166,6 +167,30 @@ Duration consumerPollTimeout() {
         return Duration.ofMillis(getLong(CONSUMER_POLL_TIMEOUT_MILLIS));
     }
 
+    public static Map<String, String> validate(Map<String, String> configs) {
+        Map<String, String> invalidConfigs = new HashMap<>();
+
+        // No point to validate when connector is disabled.
+        if ("false".equals(configs.getOrDefault(ENABLED, "true"))) {
+            return invalidConfigs;
+        }
+
+        boolean emitCheckpointDisabled = 
"false".equals(configs.getOrDefault(EMIT_CHECKPOINTS_ENABLED, "true"));
+        boolean syncGroupOffsetsDisabled = 
"false".equals(configs.getOrDefault(SYNC_GROUP_OFFSETS_ENABLED, "true"));
+
+        if (emitCheckpointDisabled && syncGroupOffsetsDisabled) {
+            Arrays.asList(SYNC_GROUP_OFFSETS_ENABLED, 
EMIT_CHECKPOINTS_ENABLED).forEach(configName -> {
+                invalidConfigs.putIfAbsent(configName, 
"MirrorCheckpointConnector can't run with both " + SYNC_GROUP_OFFSETS_ENABLED + 
" and " +

Review Comment:
   It seems to me `EMIT_CHECKPOINTS_ENABLED` does not obstruct 
`MirrorCheckpointConnector` from running since it is used to update consumer 
groups offsets of target cluster. By contrast, `SYNC_GROUP_OFFSETS_ENABLED` do 
impact the `MirrorCheckpointConnector`
   
   
   
https://github.com/apache/kafka/blob/trunk/connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorCheckpointConnector.java#L121



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to