Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Duplicate
-
None
-
None
-
None
Description
Currently the DEBUG message looks like this:
2011-07-26 04:21:52,344 DEBUG org.apache.hadoop.hbase.io.hfile.LruBlockCache: LRU Stats: total=3.24 MB, free=391.76 MB, max=395 MB, blocks=0, accesses=118458, hits=0, hitRatio=0.00%%, cachingAccesses=0, cachingHits=0, cachingHitsRatio=�%, evictions=0, evicted=0, evictedPerRun=NaN
Note the double percent on "hitRatio", and the stray character at "cachingHitsRatio".
The former is a added by the code in LruBlockCache.java:
... "hitRatio=" + (stats.getHitCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitRatio(), 2) + "%, ")) + ...
The StringUtils already adds a percent sign, so the trailing one here can be dropped.
The latter I presume is caused by the value not between 0.0 and 1.0. This should be checked and "NaN" or so displayed instead as is done for other values.