This is an automated email from the ASF dual-hosted git repository. vjasani pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push: new ab4b1d884f1 HBASE-28011 : The logStats about LruBlockCache is not accurate (#5344) ab4b1d884f1 is described below commit ab4b1d884f13d082a0906c3c3e9ec96bce7f3717 Author: guluo <lupeng_n...@qq.com> AuthorDate: Thu Aug 10 01:49:39 2023 +0800 HBASE-28011 : The logStats about LruBlockCache is not accurate (#5344) --- .../org/apache/hadoop/hbase/io/hfile/LruBlockCache.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 2b79121a3aa..9691217eec1 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 @@ -1015,12 +1015,13 @@ public class LruBlockCache implements FirstLevelBlockCache { public void logStats() { // Log size - long totalSize = heapSize(); - long freeSize = maxSize - totalSize; - LruBlockCache.LOG.info("totalSize=" + StringUtils.byteDesc(totalSize) + ", " + "freeSize=" - + StringUtils.byteDesc(freeSize) + ", " + "max=" + StringUtils.byteDesc(this.maxSize) + ", " - + "blockCount=" + getBlockCount() + ", " + "accesses=" + stats.getRequestCount() + ", " - + "hits=" + stats.getHitCount() + ", " + "hitRatio=" + long usedSize = heapSize(); + long freeSize = maxSize - usedSize; + LruBlockCache.LOG.info("totalSize=" + StringUtils.byteDesc(maxSize) + ", " + "usedSize=" + + StringUtils.byteDesc(usedSize) + ", " + "freeSize=" + StringUtils.byteDesc(freeSize) + ", " + + "max=" + StringUtils.byteDesc(this.maxSize) + ", " + "blockCount=" + getBlockCount() + ", " + + "accesses=" + stats.getRequestCount() + ", " + "hits=" + stats.getHitCount() + ", " + + "hitRatio=" + (stats.getHitCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitRatio(), 2) + ", "))