You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/02/11 22:16:19 UTC

[GitHub] [kafka] mimaison opened a new pull request #11749: MINOR: Small cleanups in mirror/mirror-client

mimaison opened a new pull request #11749:
URL: https://github.com/apache/kafka/pull/11749


   
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] hachikuji commented on a change in pull request #11749: MINOR: Small cleanups in mirror/mirror-client

Posted by GitBox <gi...@apache.org>.
hachikuji commented on a change in pull request #11749:
URL: https://github.com/apache/kafka/pull/11749#discussion_r805194799



##########
File path: connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorMakerConfig.java
##########
@@ -93,17 +93,17 @@ public MirrorMakerConfig(Map<?, ?> props) {
         Map<String, String> originalStrings = originalsStrings();
         boolean globalHeartbeatsEnabled = MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED_DEFAULT;
         if (originalStrings.containsKey(MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED)) {
-            globalHeartbeatsEnabled = Boolean.valueOf(originalStrings.get(MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED));
+            globalHeartbeatsEnabled = Boolean.parseBoolean(originalStrings.get(MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED));
         }
 
         for (String source : clusters) {
             for (String target : clusters) {
                 if (!source.equals(target)) {
                     String clusterPairConfigPrefix = source + "->" + target + ".";
-                    boolean clusterPairEnabled = Boolean.valueOf(originalStrings.getOrDefault(clusterPairConfigPrefix + "enabled", "false"));
+                    boolean clusterPairEnabled = Boolean.parseBoolean(originalStrings.get(clusterPairConfigPrefix + "enabled"));

Review comment:
       Why was the default not required?




-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] mimaison commented on a change in pull request #11749: MINOR: Small cleanups in mirror/mirror-client

Posted by GitBox <gi...@apache.org>.
mimaison commented on a change in pull request #11749:
URL: https://github.com/apache/kafka/pull/11749#discussion_r805639268



##########
File path: connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorMakerConfig.java
##########
@@ -93,17 +93,17 @@ public MirrorMakerConfig(Map<?, ?> props) {
         Map<String, String> originalStrings = originalsStrings();
         boolean globalHeartbeatsEnabled = MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED_DEFAULT;
         if (originalStrings.containsKey(MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED)) {
-            globalHeartbeatsEnabled = Boolean.valueOf(originalStrings.get(MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED));
+            globalHeartbeatsEnabled = Boolean.parseBoolean(originalStrings.get(MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED));
         }
 
         for (String source : clusters) {
             for (String target : clusters) {
                 if (!source.equals(target)) {
                     String clusterPairConfigPrefix = source + "->" + target + ".";
-                    boolean clusterPairEnabled = Boolean.valueOf(originalStrings.getOrDefault(clusterPairConfigPrefix + "enabled", "false"));
+                    boolean clusterPairEnabled = Boolean.parseBoolean(originalStrings.get(clusterPairConfigPrefix + "enabled"));

Review comment:
       `parseBoolean()` maps `null` to `false`, so we don't need to explicitly provide `false` as default.




-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] mimaison merged pull request #11749: MINOR: Small cleanups in mirror/mirror-client

Posted by GitBox <gi...@apache.org>.
mimaison merged pull request #11749:
URL: https://github.com/apache/kafka/pull/11749


   


-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] hachikuji commented on a change in pull request #11749: MINOR: Small cleanups in mirror/mirror-client

Posted by GitBox <gi...@apache.org>.
hachikuji commented on a change in pull request #11749:
URL: https://github.com/apache/kafka/pull/11749#discussion_r805194799



##########
File path: connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorMakerConfig.java
##########
@@ -93,17 +93,17 @@ public MirrorMakerConfig(Map<?, ?> props) {
         Map<String, String> originalStrings = originalsStrings();
         boolean globalHeartbeatsEnabled = MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED_DEFAULT;
         if (originalStrings.containsKey(MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED)) {
-            globalHeartbeatsEnabled = Boolean.valueOf(originalStrings.get(MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED));
+            globalHeartbeatsEnabled = Boolean.parseBoolean(originalStrings.get(MirrorConnectorConfig.EMIT_HEARTBEATS_ENABLED));
         }
 
         for (String source : clusters) {
             for (String target : clusters) {
                 if (!source.equals(target)) {
                     String clusterPairConfigPrefix = source + "->" + target + ".";
-                    boolean clusterPairEnabled = Boolean.valueOf(originalStrings.getOrDefault(clusterPairConfigPrefix + "enabled", "false"));
+                    boolean clusterPairEnabled = Boolean.parseBoolean(originalStrings.get(clusterPairConfigPrefix + "enabled"));

Review comment:
       Why was the default not required?




-- 
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-unsubscribe@kafka.apache.org

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