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

This commit is contained in:
Ted Yu 2014-06-13 02:10:15 +00:00
parent 500ba3de32
commit 62a78ab661

View File

@ -788,6 +788,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