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 30
30
import =" java.util.Optional"
31
31
import =" java.util.TreeMap"
32
32
import =" java.util.concurrent.TimeUnit"
33
+ import =" java.text.DecimalFormat"
34
+ import =" java.math.RoundingMode"
33
35
import =" org.apache.commons.lang3.StringEscapeUtils"
34
36
import =" org.apache.hadoop.conf.Configuration"
35
37
import =" org.apache.hadoop.hbase.HConstants"
927
929
((float ) totalCompactedCells / totalCompactingCells)) + " %" ;
928
930
}
929
931
if (totalBlocksTotalWeight > 0 ) {
930
- totalLocality = String . format( " %.1f " ,
931
- (( float ) totalBlocksLocalWeight / totalBlocksTotalWeight) );
932
- totalLocalityForSsd = String . format(" %.1f " ,
933
- ((float ) totalBlocksLocalWithSsdWeight / totalBlocksTotalWeight));
932
+ DecimalFormat df = new DecimalFormat ( " 0.0# " );
933
+ df . setRoundingMode( RoundingMode . DOWN );
934
+ totalLocality = df . format((( float ) totalBlocksLocalWeight / totalBlocksTotalWeight));
935
+ totalLocalityForSsd = df . format( ((float ) totalBlocksLocalWithSsdWeight / totalBlocksTotalWeight));
934
936
}
935
937
if (regions != null && regions. size() > 0 ) { % >
936
938
<div class =" row" >
You can’t perform that action at this time.
0 commit comments