From 28909b8f13a73a0c318a33e8b4641ecdffc71692 Mon Sep 17 00:00:00 2001 From: Biju Nair Date: Fri, 18 Aug 2017 16:13:13 -0400 Subject: [PATCH] HBASE-18614 Setting BUCKET_CACHE_COMBINED_KEY to false disables stats on RS UI Signed-off-by: tedyu --- .../java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java | 4 ++++ .../apache/hadoop/hbase/io/hfile/TestBlockCacheReporting.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java index c1870221ac1..dbb0d4994c4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java @@ -45,6 +45,7 @@ import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.ClassSize; import org.apache.hadoop.hbase.util.HasThread; import org.apache.hadoop.util.StringUtils; +import org.codehaus.jackson.annotate.JsonIgnore; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting; @@ -1161,7 +1162,10 @@ public class LruBlockCache implements ResizableBlockCache, HeapSize { } @Override + @JsonIgnore public BlockCache[] getBlockCaches() { + if (victimHandler != null) + return new BlockCache[] {this, this.victimHandler}; return null; } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockCacheReporting.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockCacheReporting.java index 5651c1330fe..f07cc3776e5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockCacheReporting.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockCacheReporting.java @@ -119,7 +119,7 @@ public class TestBlockCacheReporting { BlockCache [] bcs = bc.getBlockCaches(); if (bcs != null) { for (BlockCache sbc: bc.getBlockCaches()) { - bucketCacheReport(sbc); + LOG.info(bc.getClass().getSimpleName() + ": " + sbc.getStats()); } } }