HBASE-11107 Provide utility method equivalent to 0.92's Result.getBytes().getSize() (Gustavo Anatoly)
This commit is contained in:
parent
500ba3de32
commit
62a78ab661
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user