Index: conf/hbase-env.sh =================================================================== --- conf/hbase-env.sh (revision 1240895) +++ conf/hbase-env.sh (working copy) @@ -45,7 +45,7 @@ # 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 Index: src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java (revision 1240895) +++ src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java (working copy) @@ -329,7 +329,7 @@ } 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 @@ 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)); Index: src/main/resources/hbase-default.xml =================================================================== --- src/main/resources/hbase-default.xml (revision 1240895) +++ src/main/resources/hbase-default.xml (working copy) @@ -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. + + Index: src/docbkx/upgrading.xml =================================================================== --- src/docbkx/upgrading.xml (revision 1240895) +++ src/docbkx/upgrading.xml (working copy) @@ -171,7 +171,7 @@ A new cache was contributed to 0.92.0 to act as a solution between using the “on-heap” cache which is the current LRU cache the region servers have and the operating system cache which is out of our control. -To enable, set “-XX:MaxDirectMemorySize” in hbase-env.sh to the value that you want to dedicate to that cache. This should only be set for servers and not for clients; in fact, if you already had to add that configuration on for any reason and still use it today it’s going to enable this feature. Use at your own risk. +To enable, set “-XX:MaxDirectMemorySize” in hbase-env.sh to the value for maximum direct memory size and specify hbase.offheapcache.percentage in hbase-site.xml with the percentage that you want to dedicate to off-heap cache. This should only be set for servers and not for clients. Use at your own risk. See this blog post for additional information on this new experimental feature: http://www.cloudera.com/blog/2012/01/caching-in-hbase-slabcache/