diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/PutSortReducer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/PutSortReducer.java index 1706aecf44c..5533badfb25 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/PutSortReducer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/PutSortReducer.java @@ -67,9 +67,11 @@ public class PutSortReducer extends for (Cell cell: cells) { KeyValue kv = KeyValueUtil.ensureKeyValueTypeForMR(cell); map.add(kv); - curSize += kv.heapSize(); } } + for(KeyValue kv: map){ + curSize +=kv.heapSize(); + } } context.setStatus("Read " + map.size() + " entries of " + map.getClass() + "(" + StringUtils.humanReadableInt(curSize) + ")");