You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/10/25 07:35:11 UTC

[GitHub] [nifi] nathluu commented on a diff in pull request #6400: NIFI-10481 Add NiFi configuration to disable zk client ensembleTracker

nathluu commented on code in PR #6400:
URL: https://github.com/apache/nifi/pull/6400#discussion_r1004109591


##########
nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java:
##########
@@ -1707,6 +1709,17 @@ public boolean isZooKeeperClientSecure() {
         return Boolean.parseBoolean(clientSecure);
     }
 
+    public boolean isZookeeperClientWithEnsembleTracker() {
+        final String defaultValue = String.valueOf(DEFAULT_ZOOKEEPER_CLIENT_ENSEMBLE_TRACKER);
+        final String withEnsembleTracker = getProperty(ZOOKEEPER_CLIENT_ENSEMBLE_TRACKER, defaultValue).trim();
+
+        if (!"true".equalsIgnoreCase(withEnsembleTracker) && !"false".equalsIgnoreCase(withEnsembleTracker)) {

Review Comment:
   Below is the definition of Boolean.valueOf() method. It returns `true` for the string "true" and `false` for any other string. I think it would be better to keep the validation rule strict so that only "true" or "false" is acceptable.
   ```
       public static Boolean valueOf(String s) {
           return parseBoolean(s) ? TRUE : FALSE;
       }
   
       public static boolean parseBoolean(String s) {
           return ((s != null) && s.equalsIgnoreCase("true"));
       }
   ```



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

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