[GitHub] keith-turner commented on a change in pull request #372: ACCUMULO-4779 Improved performance get by prefix in config

2018-02-02 Thread GitBox
keith-turner commented on a change in pull request #372: ACCUMULO-4779 Improved 
performance get by prefix in config
URL: https://github.com/apache/accumulo/pull/372#discussion_r165719887
 
 

 ##
 File path: 
server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
 ##
 @@ -167,4 +167,9 @@ public synchronized void invalidateCache() {
 // to see if it happened to be created so we could invalidate its cache
 // but I don't see much benefit coming from that extra check.
   }
+
+  @Override
+  public long getUpdateCount() {
+return Math.max(parent.getUpdateCount(), 
getPropCacheAccessor().getZooCache().getUpdateCount());
 
 Review comment:
   Nice catch.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] keith-turner commented on a change in pull request #372: ACCUMULO-4779 Improved performance get by prefix in config

2018-02-02 Thread GitBox
keith-turner commented on a change in pull request #372: ACCUMULO-4779 Improved 
performance get by prefix in config
URL: https://github.com/apache/accumulo/pull/372#discussion_r165719829
 
 

 ##
 File path: 
core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
 ##
 @@ -33,15 +36,28 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
 import com.google.common.base.Predicate;
 import com.google.common.base.Predicates;
+import com.google.common.collect.ImmutableMap;
 
 /**
  * A configuration object.
  */
 public abstract class AccumuloConfiguration implements 
Iterable> {
 
+  private static class PrefixProps {
+final long updateCount;
+final Map props;
+
+PrefixProps(Map props, long updateCount) {
 
 Review comment:
   Using a boolean would require more synchronization.  If a boolean was used 
syncronization would be needed to prevent the config subclasses from changing 
while the cache of prefix props was being updated.  Without this sync, changes 
could be missed if the boolean is set to false after updating the cache but 
changes occurred concurrently with updating the cache.


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:
us...@infra.apache.org


With regards,
Apache Git Services