You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2014/06/23 23:30:47 UTC

git commit: HBASE-11398 Print the stripes' state with file size info (Victor Xu)

Repository: hbase
Updated Branches:
  refs/heads/master 54a537571 -> 092fc71b1


HBASE-11398 Print the stripes' state with file size info (Victor Xu)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/092fc71b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/092fc71b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/092fc71b

Branch: refs/heads/master
Commit: 092fc71b182f3c364f5cb3b2e793ef5c78a0c4bc
Parents: 54a5375
Author: Ted Yu <te...@apache.org>
Authored: Mon Jun 23 21:30:40 2014 +0000
Committer: Ted Yu <te...@apache.org>
Committed: Mon Jun 23 21:30:40 2014 +0000

----------------------------------------------------------------------
 .../hbase/regionserver/StripeStoreFileManager.java    | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/092fc71b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java
index 36661b3..c297c56 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java
@@ -40,6 +40,7 @@ import org.apache.hadoop.hbase.KeyValue.KVComparator;
 import org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.ConcatenatedLists;
+import org.apache.hadoop.util.StringUtils;
 
 import com.google.common.collect.ImmutableCollection;
 import com.google.common.collect.ImmutableList;
@@ -472,13 +473,22 @@ public class StripeStoreFileManager
     if (!LOG.isDebugEnabled()) return;
     StringBuilder sb = new StringBuilder();
     sb.append("\n" + string + "; current stripe state is as such:");
-    sb.append("\n level 0 with ").append(state.level0Files.size()).append(" files;");
+    sb.append("\n level 0 with ").append(state.level0Files.size())
+        .append(
+          " files: "
+              + StringUtils.humanReadableInt(StripeCompactionPolicy
+                  .getTotalFileSize(state.level0Files)) + ";");
     for (int i = 0; i < state.stripeFiles.size(); ++i) {
       String endRow = (i == state.stripeEndRows.length)
           ? "(end)" : "[" + Bytes.toString(state.stripeEndRows[i]) + "]";
       sb.append("\n stripe ending in ").append(endRow).append(" with ")
-        .append(state.stripeFiles.get(i).size()).append(" files;");
+          .append(state.stripeFiles.get(i).size())
+          .append(
+            " files: "
+                + StringUtils.humanReadableInt(StripeCompactionPolicy
+                    .getTotalFileSize(state.stripeFiles.get(i))) + ";");
     }
+    sb.append("\n").append(state.stripeFiles.size()).append(" stripes total.");
     sb.append("\n").append(getStorefileCount()).append(" files total.");
     LOG.debug(sb.toString());
   }