This is an automated email from the ASF dual-hosted git repository.
reidchan pushed a commit to branch branch-2.2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.2 by this push:
new 87b0040 HBASE-22610 [BucketCache] Rename
hbase.offheapcache.minblocksize
87b0040 is described below
commit 87b00408c133f75bcf8ab97834d27a879e46b54a
Author: syedmurtazahassan <[email protected]>
AuthorDate: Tue Jul 23 10:55:09 2019 +0800
HBASE-22610 [BucketCache] Rename hbase.offheapcache.minblocksize
Co-authored-by: Reid Chan <[email protected]>
Signed-off-by: Reid Chan <[email protected]>
---
.../hadoop/hbase/io/hfile/BlockCacheFactory.java | 24 +++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheFactory.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheFactory.java
index 98b3c4f..01fb130 100644
---
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheFactory.java
+++
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheFactory.java
@@ -71,20 +71,38 @@ public final class BlockCacheFactory {
/**
* 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;
private static final String EXTERNAL_BLOCKCACHE_CLASS_KEY =
"hbase.blockcache.external.class";
+ /**
+ * @deprecated use {@link BlockCacheFactory#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);
+ }
+
private BlockCacheFactory() {
}
public static BlockCache createBlockCache(Configuration conf) {
+ 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);
+ }
LruBlockCache onHeapCache = createOnHeapCache(conf);
if (onHeapCache == null) {
return null;