You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bu...@apache.org on 2019/10/29 15:38:00 UTC
[hbase] branch branch-2 updated: HBASE-23208 Unit formatting in
Master & RS UI
This is an automated email from the ASF dual-hosted git repository.
busbey pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2 by this push:
new fe23e3f HBASE-23208 Unit formatting in Master & RS UI
fe23e3f is described below
commit fe23e3fd5b14023402ea2b1884c265444bf81c75
Author: Karthik Palanisamy <kp...@cloudera.com>
AuthorDate: Wed Oct 23 15:14:01 2019 -0700
HBASE-23208 Unit formatting in Master & RS UI
Signed-off-by: binlijin <bi...@gmail.com>
Signed-off-by: Sean Busbey <bu...@apache.org>
(cherry picked from commit 257ccad31c0886080814138aec92beb1970a54d6)
---
.../hadoop/hbase/procedure2/util/StringUtils.java | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/util/StringUtils.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/util/StringUtils.java
index 98f05fa..fddc999 100644
--- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/util/StringUtils.java
+++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/util/StringUtils.java
@@ -27,7 +27,7 @@ public final class StringUtils {
public static String humanTimeDiff(long timeDiff) {
if (timeDiff < 1000) {
- return String.format("%dmsec", timeDiff);
+ return String.format("%d msec", timeDiff);
}
StringBuilder buf = new StringBuilder();
@@ -39,36 +39,36 @@ public final class StringUtils {
if (hours != 0){
buf.append(hours);
- buf.append("hrs, ");
+ buf.append(" hrs, ");
}
if (minutes != 0){
buf.append(minutes);
- buf.append("mins, ");
+ buf.append(" mins, ");
}
if (hours > 0 || minutes > 0) {
buf.append(seconds);
- buf.append("sec");
+ buf.append(" sec");
} else {
- buf.append(String.format("%.4fsec", seconds));
+ buf.append(String.format("%.4f sec", seconds));
}
return buf.toString();
}
public static String humanSize(double size) {
if (size >= (1L << 40)) {
- return String.format("%.1fT", size / (1L << 40));
+ return String.format("%.1f T", size / (1L << 40));
}
if (size >= (1L << 30)) {
- return String.format("%.1fG", size / (1L << 30));
+ return String.format("%.1f G", size / (1L << 30));
}
if (size >= (1L << 20)) {
- return String.format("%.1fM", size / (1L << 20));
+ return String.format("%.1f M", size / (1L << 20));
}
if (size >= (1L << 10)) {
- return String.format("%.1fK", size / (1L << 10));
+ return String.format("%.1f K", size / (1L << 10));
}
return String.format("%.0f", size);