HBASE-18614 Setting BUCKET_CACHE_COMBINED_KEY to false disables stats on RS UI

Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
Biju Nair 2017-08-18 16:13:13 -04:00 committed by tedyu
parent e9ea19fba6
commit 28909b8f13
2 changed files with 5 additions and 1 deletions

View File

@ -45,6 +45,7 @@ import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.ClassSize; import org.apache.hadoop.hbase.util.ClassSize;
import org.apache.hadoop.hbase.util.HasThread; import org.apache.hadoop.hbase.util.HasThread;
import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.util.StringUtils;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting; import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
@ -1161,7 +1162,10 @@ public class LruBlockCache implements ResizableBlockCache, HeapSize {
} }
@Override @Override
@JsonIgnore
public BlockCache[] getBlockCaches() { public BlockCache[] getBlockCaches() {
if (victimHandler != null)
return new BlockCache[] {this, this.victimHandler};
return null; return null;
} }

View File

@ -119,7 +119,7 @@ public class TestBlockCacheReporting {
BlockCache [] bcs = bc.getBlockCaches(); BlockCache [] bcs = bc.getBlockCaches();
if (bcs != null) { if (bcs != null) {
for (BlockCache sbc: bc.getBlockCaches()) { for (BlockCache sbc: bc.getBlockCaches()) {
bucketCacheReport(sbc); LOG.info(bc.getClass().getSimpleName() + ": " + sbc.getStats());
} }
} }
} }