This is an automated email from the ASF dual-hosted git repository.
reidchan pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 49fcd92 HBASE-22610 [BucketCache] Rename
hbase.offheapcache.minblocksize
49fcd92 is described below
commit 49fcd92bdf46fc130f20202c3f6693e88272ab04
Author: syedmurtazahassan <[email protected]>
AuthorDate: Tue Jul 23 12:05:31 2019 +0800
HBASE-22610 [BucketCache] Rename hbase.offheapcache.minblocksize
Co-authored-by: Reid Chan <[email protected]>
Signed-off-by: Reid Chan <[email protected]>
---
.../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 a022552..499130a 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
@@ -131,10 +131,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;
@@ -145,6 +143,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.
*/
@@ -646,6 +659,11 @@ public class CacheConfig {
if (GLOBAL_BLOCK_CACHE_INSTANCE != null) {
return GLOBAL_BLOCK_CACHE_INSTANCE;
}
+ if (conf.get(DEPRECATED_BLOCKCACHE_BLOCKSIZE_KEY) != null) {
+ LOG.warn("The config key {} is deprecated now, instead please use {}. In
future release "
+ + "we will remove the deprecated config.",
DEPRECATED_BLOCKCACHE_BLOCKSIZE_KEY,
+ BLOCKCACHE_BLOCKSIZE_KEY);
+ }
if (blockCacheDisabled) {
return null;
}