You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by br...@apache.org on 2020/07/27 23:37:35 UTC

[hbase] branch branch-1 updated: HBASE-24775 [hbtop] StoreFile size should be rounded off (#2144)

This is an automated email from the ASF dual-hosted git repository.

brfrn169 pushed a commit to branch branch-1
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-1 by this push:
     new b0d49ae  HBASE-24775 [hbtop] StoreFile size should be rounded off (#2144)
b0d49ae is described below

commit b0d49aebeaf05a5cc045eeda7b819cccf7cbee9d
Author: Toshihiro Suzuki <br...@gmail.com>
AuthorDate: Tue Jul 28 08:14:45 2020 +0900

    HBASE-24775 [hbtop] StoreFile size should be rounded off (#2144)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    Signed-off-by: Viraj Jasani <vj...@apache.org>
---
 .../main/java/org/apache/hadoop/hbase/hbtop/field/FieldValue.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/field/FieldValue.java b/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/field/FieldValue.java
index db7d22f..bbfe508 100644
--- a/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/field/FieldValue.java
+++ b/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/field/FieldValue.java
@@ -174,9 +174,12 @@ public final class FieldValue implements Comparable<FieldValue> {
       case INTEGER:
       case LONG:
       case FLOAT:
-      case SIZE:
         return value.toString();
 
+      case SIZE:
+        Size size = (Size) value;
+        return String.format("%.1f", size.get()) + size.getUnit().getSimpleName();
+
       case PERCENT:
         return String.format("%.2f", (Float) value) + "%";