accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [2/2] accumulo git commit: ACCUMULO-4041 memoize isSensitive for faster lookups in getSiteConfiguration
Date Fri, 13 Nov 2015 13:42:53 GMT
ACCUMULO-4041 memoize isSensitive for faster lookups in getSiteConfiguration


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/81b6d5b9
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/81b6d5b9
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/81b6d5b9

Branch: refs/heads/1.7
Commit: 81b6d5b94d4e99d68fd0fcc07433e25219cecd94
Parents: b8ffe4c 78522c4
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Fri Nov 13 06:57:34 2015 -0500
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Fri Nov 13 06:57:34 2015 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/accumulo/core/conf/Property.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/81b6d5b9/core/src/main/java/org/apache/accumulo/core/conf/Property.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/conf/Property.java
index 055e7dd,6d1f043..df53791
--- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
@@@ -668,23 -523,15 +668,28 @@@ public enum Property 
      return hasAnnotation(Deprecated.class) || hasPrefixWithAnnotation(getKey(), Deprecated.class);
    }
  
+   private volatile Boolean isSensitive = null;
+ 
 +  /**
 +   * Checks if this property is sensitive.
 +   *
 +   * @return true if this property is sensitive
 +   */
    public boolean isSensitive() {
-     return hasAnnotation(Sensitive.class) || hasPrefixWithAnnotation(getKey(), Sensitive.class);
+     if (isSensitive == null) {
+       isSensitive = hasAnnotation(Sensitive.class) || hasPrefixWithAnnotation(getKey(),
Sensitive.class);
+     }
+     return isSensitive.booleanValue();
    }
  
 +  /**
 +   * Checks if a property with the given key is sensitive. The key must be for a valid property,
and must either itself be annotated as sensitive or have a
 +   * prefix annotated as sensitive.
 +   *
 +   * @param key
 +   *          property key
 +   * @return true if property is sensitive
 +   */
    public static boolean isSensitive(String key) {
      return hasPrefixWithAnnotation(key, Sensitive.class);
    }


Mime
View raw message