This is an automated email from the ASF dual-hosted git repository. reidchan pushed a commit to branch branch-1.4 in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-1.4 by this push: new 4502b55 HBASE-22610 [BucketCache] Rename hbase.offheapcache.minblocksize 4502b55 is described below commit 4502b55bdc863868bc452b7876c15c0ad7400c1e Author: syedmurtazahassan <syedmurtazaha...@gmail.com> AuthorDate: Tue Jul 23 12:19:08 2019 +0800 HBASE-22610 [BucketCache] Rename hbase.offheapcache.minblocksize Co-authored-by: Reid Chan <reidc...@apache.org> Signed-off-by: Reid Chan <reidc...@apache.org> --- .../apache/hadoop/hbase/io/hfile/CacheConfig.java | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java index d020eb0..87eae04 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java @@ -129,10 +129,8 @@ public class CacheConfig { /** * The target block size used by blockcache instances. Defaults to * {@link HConstants#DEFAULT_BLOCKSIZE}. - * TODO: this config point is completely wrong, as it's used to determine the - * target block size of BlockCache instances. Rename. */ - public static final String BLOCKCACHE_BLOCKSIZE_KEY = "hbase.offheapcache.minblocksize"; + public static final String BLOCKCACHE_BLOCKSIZE_KEY = "hbase.blockcache.minblocksize"; private static final String EXTERNAL_BLOCKCACHE_KEY = "hbase.blockcache.use.external"; private static final boolean EXTERNAL_BLOCKCACHE_DEFAULT = false; @@ -142,6 +140,21 @@ public class CacheConfig { private static final boolean DROP_BEHIND_CACHE_COMPACTION_DEFAULT = true; /** + * @deprecated use {@link CacheConfig#BLOCKCACHE_BLOCKSIZE_KEY} instead. + */ + @Deprecated + static final String DEPRECATED_BLOCKCACHE_BLOCKSIZE_KEY = "hbase.offheapcache.minblocksize"; + + /** + * The config point hbase.offheapcache.minblocksize is completely wrong, which is replaced by + * {@link BlockCacheFactory#BLOCKCACHE_BLOCKSIZE_KEY}. Keep the old config key here for backward + * compatibility. + */ + static { + Configuration.addDeprecation(DEPRECATED_BLOCKCACHE_BLOCKSIZE_KEY, BLOCKCACHE_BLOCKSIZE_KEY); + } + + /** * Enum of all built in external block caches. * This is used for config. */ @@ -675,6 +688,11 @@ public class CacheConfig { public static synchronized BlockCache instantiateBlockCache(Configuration conf) { if (GLOBAL_BLOCK_CACHE_INSTANCE != null) return GLOBAL_BLOCK_CACHE_INSTANCE; if (blockCacheDisabled) return null; + if (conf.get(DEPRECATED_BLOCKCACHE_BLOCKSIZE_KEY) != null) { + LOG.warn("The config key " + DEPRECATED_BLOCKCACHE_BLOCKSIZE_KEY + + " is deprecated now, instead please use " + BLOCKCACHE_BLOCKSIZE_KEY +". " + + "In future release we will remove the deprecated config."); + } LruBlockCache l1 = getL1(conf); // blockCacheDisabled is set as a side-effect of getL1Internal(), so check it again after the call. if (blockCacheDisabled) return null;