File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
hbase-server/src/main/resources/hbase-webapps/master Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 29
29
import =" java.util.Optional"
30
30
import =" java.util.TreeMap"
31
31
import =" java.util.concurrent.TimeUnit"
32
+ import =" java.text.DecimalFormat"
33
+ import =" java.math.RoundingMode"
32
34
import =" org.apache.commons.lang3.StringEscapeUtils"
33
35
import =" org.apache.hadoop.conf.Configuration"
34
36
import =" org.apache.hadoop.hbase.HConstants"
928
930
((float ) totalCompactedCells / totalCompactingCells)) + " %" ;
929
931
}
930
932
if (totalBlocksTotalWeight > 0 ) {
931
- totalLocality = String . format( " %.1f " ,
932
- (( float ) totalBlocksLocalWeight / totalBlocksTotalWeight) );
933
- totalLocalityForSsd = String . format(" %.1f " ,
934
- ((float ) totalBlocksLocalWithSsdWeight / totalBlocksTotalWeight));
933
+ DecimalFormat df = new DecimalFormat ( " 0.0# " );
934
+ df . setRoundingMode( RoundingMode . DOWN );
935
+ totalLocality = df . format((( float ) totalBlocksLocalWeight / totalBlocksTotalWeight));
936
+ totalLocalityForSsd = df . format( ((float ) totalBlocksLocalWithSsdWeight / totalBlocksTotalWeight));
935
937
}
936
938
if (regions != null && regions. size() > 0 ) { % >
937
939
<div class =" row" >
You can’t perform that action at this time.
0 commit comments