You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2017/12/01 18:27:25 UTC
[accumulo] branch master updated: ACCUMULO-4743 Replaced general
custom with tserver prefix for cache config (#328)
This is an automated email from the ASF dual-hosted git repository.
kturner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/master by this push:
new f565b3a ACCUMULO-4743 Replaced general custom with tserver prefix for cache config (#328)
f565b3a is described below
commit f565b3aa48369c9b0df08f2786b433c30316b1a4
Author: Jared <15...@users.noreply.github.com>
AuthorDate: Fri Dec 1 13:27:23 2017 -0500
ACCUMULO-4743 Replaced general custom with tserver prefix for cache config (#328)
---
.../file/blockfile/cache/BlockCacheManager.java | 24 ++++++++++++----------
.../cache/impl/BlockCacheConfiguration.java | 2 +-
.../blockfile/cache/BlockCacheManagerTest.java | 8 ++++----
3 files changed, 18 insertions(+), 16 deletions(-)
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 f19167c..4c75c4d 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 @@ public abstract class BlockCacheManager {
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 @@ public abstract class BlockCacheManager {
* 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 abstract class BlockCacheManager {
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 abstract class BlockCacheManager {
}
/**
- * 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 7bf7503..52f6c89 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 @@ public class BlockCacheConfiguration implements Configuration {
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 7bfd511..936cf5e 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 @@ public class BlockCacheManagerTest {
@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"));
}
}
--
To stop receiving notification emails like this one, please contact
['"commits@accumulo.apache.org" <co...@accumulo.apache.org>'].