diff --git a/conf/hbase-env.sh b/conf/hbase-env.sh index 907372b..bc293b4 100644 --- a/conf/hbase-env.sh +++ b/conf/hbase-env.sh @@ -45,7 +45,7 @@ export HBASE_OPTS="-XX:+UseConcMarkSweepGC" # Uncomment below if you intend to use the EXPERIMENTAL off heap cache. # export HBASE_OPTS="$HBASE_OPTS -XX:MaxDirectMemorySize=" -# Set hbase.offheapcachesize in hbase-site.xml +# Set hbase.offheapcache.percentage in hbase-site.xml to a nonzero value. # Uncomment and adjust to enable JMX exporting diff --git a/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java b/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java index c92cc02..3c2e722 100644 --- a/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java +++ b/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java @@ -329,7 +329,7 @@ public class CacheConfig { } if (cachePercentage > 1.0) { throw new IllegalArgumentException(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY + - " must be between 0.0 and 1.0, not > 1.0"); + " must be between 0.0 and 1.0, and not > 1.0"); } // Calculate the amount of heap to give the heap. @@ -338,7 +338,7 @@ public class CacheConfig { int blockSize = conf.getInt("hbase.offheapcache.minblocksize", HFile.DEFAULT_BLOCKSIZE); long offHeapCacheSize = - (long) (conf.getFloat("hbase.offheapcache.percentage", (float) 0.95) * + (long) (conf.getFloat("hbase.offheapcache.percentage", (float) 0) * DirectMemoryUtils.getDirectMemorySize()); LOG.info("Allocating LruBlockCache with maximum size " + StringUtils.humanReadableInt(cacheSize)); diff --git a/src/main/resources/hbase-default.xml b/src/main/resources/hbase-default.xml index 99f3194..c2dd129 100644 --- a/src/main/resources/hbase-default.xml +++ b/src/main/resources/hbase-default.xml @@ -851,4 +851,13 @@ hbase.thrift.maxQueuedRequests threads. + + hbase.offheapcache.percentage + 0 + + The amount of off heap space to be allocated towards the experimental + off heap cache. If you desire the cache to be disabled, simply set this + value to 0. + +