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()); } } }