From f3a02af2183477c28d14227ff07e25ec3010b992 Mon Sep 17 00:00:00 2001 From: Puleya7 Date: Fri, 10 May 2019 16:31:30 +0800 Subject: [PATCH] HBASE-22367. Extra commas in LruBlockCache.logStats between hitRatio and cachingAccesses if hitCount is not 0 --- .../src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 d030f831a2..f790310f34 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 @@ -942,11 +942,11 @@ public class LruBlockCache implements ResizableBlockCache, HeapSize { "accesses=" + stats.getRequestCount() + ", " + "hits=" + stats.getHitCount() + ", " + "hitRatio=" + (stats.getHitCount() == 0 ? - "0" : (StringUtils.formatPercent(stats.getHitRatio(), 2)+ ", ")) + ", " + + "0%" : (StringUtils.formatPercent(stats.getHitRatio(), 2))) + ", " + "cachingAccesses=" + stats.getRequestCachingCount() + ", " + "cachingHits=" + stats.getHitCachingCount() + ", " + "cachingHitsRatio=" + (stats.getHitCachingCount() == 0 ? - "0,": (StringUtils.formatPercent(stats.getHitCachingRatio(), 2) + ", ")) + + "0%": (StringUtils.formatPercent(stats.getHitCachingRatio(), 2))) + ", " + "evictions=" + stats.getEvictionCount() + ", " + "evicted=" + stats.getEvictedCount() + ", " + "evictedPerRun=" + stats.evictedPerEviction()); -- 2.11.0 (Apple Git-81)