You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by jm...@apache.org on 2021/08/04 17:21:21 UTC

[accumulo] branch main updated: Pretty-print PrintInfo's 'histogram' output (#2220)

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

jmanno pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new 1e9ac21  Pretty-print PrintInfo's 'histogram' output  (#2220)
1e9ac21 is described below

commit 1e9ac217e36813b9f5a1d2c904ee790fbbea8f43
Author: Shivakumar <47...@users.noreply.github.com>
AuthorDate: Wed Aug 4 22:51:10 2021 +0530

    Pretty-print PrintInfo's 'histogram' output  (#2220)
    
    * PrettyPrint printInfo's 'histogram' output to be more human-readable.
    
    Co-authored-by: Jeffrey Manno <je...@gmail.com>
---
 .../main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
index 4423a0c..55d188c 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
@@ -40,6 +40,7 @@ import org.apache.accumulo.core.file.rfile.bcfile.Utils;
 import org.apache.accumulo.core.spi.crypto.NoFileEncrypter;
 import org.apache.accumulo.core.summary.SummaryReader;
 import org.apache.accumulo.core.util.LocalityGroupUtil;
+import org.apache.accumulo.core.util.NumUtil;
 import org.apache.accumulo.start.spi.KeywordExecutable;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.math3.stat.descriptive.SummaryStatistics;
@@ -106,10 +107,11 @@ public class PrintInfo implements KeywordExecutable {
     }
 
     public void print(String indent) {
-      System.out.println(indent + "Up to size      count      %-age");
+      System.out.println(indent + "Up to size      Count      %-age");
       for (int i = 1; i < countBuckets.length; i++) {
-        System.out.println(String.format("%s%11.0f : %10d %6.2f%%", indent, Math.pow(10, i),
-            countBuckets[i], sizeBuckets[i] * 100. / totalSize));
+        System.out.println(String.format("%s%11s : %10d %6.2f%%", indent,
+            NumUtil.bigNumberForQuantity((long) Math.pow(10, i)), countBuckets[i],
+            sizeBuckets[i] * 100. / totalSize));
       }
     }
   }