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 2017/12/01 18:27:27 UTC

[GitHub] keith-turner closed pull request #328: ACCUMULO-4743 Replaced general custom with tserver prefix for cache config

keith-turner closed pull request #328: ACCUMULO-4743 Replaced general custom with tserver prefix for cache config
URL: https://github.com/apache/accumulo/pull/328
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManager.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManager.java
index f19167c727..4c75c4dadb 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManager.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManager.java
@@ -30,14 +30,14 @@
 
   private final Map<CacheType,BlockCache> caches = new HashMap<>();
 
-  public static final String CACHE_PROPERTY_BASE = Property.GENERAL_ARBITRARY_PROP_PREFIX + "cache.";
+  public static final String CACHE_PROPERTY_BASE = Property.TSERV_PREFIX + "cache.config.";
 
   public static interface Configuration {
 
     /**
      * Before Accumulo's cache implementation was configurable, its built in caches had a configurable size. These sizes were specified by the system properties
-     * {@code tserver.cache.data.size}, {@code tserver.cache.index.size}, and {code tserver.cache.summary.size}. This method returns the values of those
-     * settings. The settings are made available, but cache implementations are under no obligation to use them.
+     * {@code tserver.cache.config.data.size}, {@code tserver.cache.config.index.size}, and {code tserver.cache.config.summary.size}. This method returns the
+     * values of those settings. The settings are made available, but cache implementations are under no obligation to use them.
      *
      */
     long getMaxSize(CacheType type);
@@ -54,17 +54,19 @@
      * This method provides a way for a cache implementation to access arbitrary configuration set by a user.
      *
      * <p>
-     * Returns all Accumulo properties that have a prefix of {@code general.custom.cache.<prefix>.<type>.} or {@code general.custom.cache.<prefix>.default.}
-     * with values for specific cache types overriding defaults.
+     * Returns all Accumulo properties that have a prefix of {@code tserver.cache.config.<prefix>.<type>.} or {@code tserver.cache.config.<prefix>.default.}
+     * with
+     * values for
+     * specific cache types overriding defaults.
      *
      * <p>
      * For example assume the following data is in Accumulo's system config.
      *
      * <pre>
-     * general.custom.cache.lru.default.evictAfter=3600
-     * general.custom.cache.lru.default.loadFactor=.75
-     * general.custom.cache.lru.index.loadFactor=.55
-     * general.custom.cache.lru.data.loadFactor=.65
+     * tserver.cache.config.lru.default.evictAfter=3600
+     * tserver.cache.config.lru.default.loadFactor=.75
+     * tserver.cache.config.lru.index.loadFactor=.55
+     * tserver.cache.config.lru.data.loadFactor=.65
      * </pre>
      *
      * <p>
@@ -123,7 +125,7 @@ public BlockCache getBlockCache(CacheType type) {
   protected abstract BlockCache createCache(Configuration conf, CacheType type);
 
   /**
-   * A convenience method that returns a string of the from {@code general.custom.cache.<prefix>.default.} this method is useful for configuring a cache
+   * A convenience method that returns a string of the from {@code tserver.cache.config.<prefix>.default.} this method is useful for configuring a cache
    * manager.
    *
    * @param prefix
@@ -135,7 +137,7 @@ public static String getFullyQualifiedPropertyPrefix(String prefix) {
   }
 
   /**
-   * A convenience method that returns a string of the from {@code general.custom.cache.<prefix>.<type>.} this method is useful for configuring a cache manager.
+   * A convenience method that returns a string of the from {@code tserver.cache.config.<prefix>.<type>.} this method is useful for configuring a cache manager.
    *
    * @param prefix
    *          A unique identifier that corresponds to a particular BlockCacheManager implementation.
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/impl/BlockCacheConfiguration.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/impl/BlockCacheConfiguration.java
index 7bf7503ff8..52f6c892c9 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/impl/BlockCacheConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/impl/BlockCacheConfiguration.java
@@ -41,7 +41,7 @@
   private final long summaryMaxSize;
 
   public BlockCacheConfiguration(AccumuloConfiguration conf) {
-    genProps = conf.getAllPropertiesWithPrefix(Property.GENERAL_ARBITRARY_PROP_PREFIX);
+    genProps = conf.getAllPropertiesWithPrefix(Property.TSERV_PREFIX);
 
     this.indexMaxSize = conf.getAsBytes(Property.TSERV_INDEXCACHE_SIZE);
     this.dataMaxSize = conf.getAsBytes(Property.TSERV_DATACACHE_SIZE);
diff --git a/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManagerTest.java b/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManagerTest.java
index 7bfd511ea9..936cf5e223 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManagerTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManagerTest.java
@@ -24,10 +24,10 @@
 
   @Test
   public void testGetPropertyPrefix() throws Exception {
-    Assert.assertEquals("general.custom.cache.lru.data.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru", CacheType.DATA));
-    Assert.assertEquals("general.custom.cache.lru.index.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru", CacheType.INDEX));
-    Assert.assertEquals("general.custom.cache.lru.summary.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru", CacheType.SUMMARY));
-    Assert.assertEquals("general.custom.cache.lru.default.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru"));
+    Assert.assertEquals("tserver.cache.config.lru.data.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru", CacheType.DATA));
+    Assert.assertEquals("tserver.cache.config.lru.index.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru", CacheType.INDEX));
+    Assert.assertEquals("tserver.cache.config.lru.summary.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru", CacheType.SUMMARY));
+    Assert.assertEquals("tserver.cache.config.lru.default.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru"));
   }
 
 }
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java
index 6033ce0b72..75ea3cbc7e 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java
@@ -61,7 +61,8 @@
   /**
    * Get HTML for CSS and JS imports from configuration. See ACCUMULO-4739
    *
-   * @param model map of the MVC model
+   * @param model
+   *          map of the MVC model
    */
   private void addExternalResources(Map<String,Object> model) {
     AccumuloConfiguration conf = Monitor.getContext().getConfiguration();


 

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