You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/11/01 15:05:14 UTC

[GitHub] keith-turner commented on a change in pull request #740: Avoid ZK watch when checking if property is set

keith-turner commented on a change in pull request #740: Avoid ZK watch when checking if property is set
URL: https://github.com/apache/accumulo/pull/740#discussion_r230074426
 
 

 ##########
 File path: server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
 ##########
 @@ -98,9 +103,26 @@ public String get(Property property) {
   }
 
   @Override
-  public boolean isPropertySet(Property prop) {
-    return fixedProps.containsKey(prop.getKey()) || getRaw(prop.getKey()) != null
-        || parent.isPropertySet(prop);
+  public boolean isPropertySet(Property prop, boolean cacheAndWatch) {
+    if (fixedProps.containsKey(prop.getKey())) {
+      return true;
+    }
+    if (cacheAndWatch) {
+      if (getRaw(prop.getKey()) != null) {
+        return true;
+      }
+    } else {
+      ZooReader zr = context.getZooReaderWriter();
+      String zPath = propPathPrefix + "/" + prop.getKey();
+      try {
+        if (zr.exists(zPath) && zr.getData(zPath, null) != null) {
 
 Review comment:
   I am not sure the calls to `exists()` and `getData()` are needed.   May be able to just call `exists()`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services