mikewalch 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_r230190321
 
 

 ##########
 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 think `exists()` will work

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to