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/13 04:10:29 UTC

git commit: HBASE-11107 Provide utility method equivalent to 0.92's Result.getBytes().getSize() (Gustavo Anatoly)

Repository: hbase
Updated Branches:
  refs/heads/master 500ba3de3 -> 62a78ab66


HBASE-11107 Provide utility method equivalent to 0.92's Result.getBytes().getSize() (Gustavo Anatoly)


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

Branch: refs/heads/master
Commit: 62a78ab661ef432dfe054d0c15258057250fbc78
Parents: 500ba3d
Author: Ted Yu <te...@apache.org>
Authored: Fri Jun 13 02:10:15 2014 +0000
Committer: Ted Yu <te...@apache.org>
Committed: Fri Jun 13 02:10:15 2014 +0000

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/client/Result.java    | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/62a78ab6/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java
index 0002b1c..b3f7076 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java
@@ -789,6 +789,19 @@ public class Result implements CellScannable {
   }
 
   /**
+   * Get total size of raw cells 
+   * @param result
+   * @return Total size.
+   */
+  public static long getTotalSizeOfCells(Result result) {
+    long size = 0;
+    for (Cell c : result.rawCells()) {
+      size += KeyValueUtil.ensureKeyValue(c).heapSize();
+    }
+    return size;
+  }
+
+  /**
    * Copy another Result into this one. Needed for the old Mapred framework
    * @param other
    */