hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [2/2] hbase git commit: HBASE-15171 Addendum removes extra loop (Yu Li)
Date Wed, 10 Feb 2016 08:10:15 GMT
HBASE-15171 Addendum removes extra loop (Yu Li)

Amending-Author: Andrew Purtell <apurtell@apache.org>


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

Branch: refs/heads/0.98
Commit: de149d0bc4eda960e7246c79a1ad85c9cbe50de0
Parents: 38cd179
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Jan 28 07:08:03 2016 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed Feb 10 00:08:55 2016 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/mapreduce/PutSortReducer.java     | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/de149d0b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/PutSortReducer.java
----------------------------------------------------------------------
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 dbf4e30..792686a 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
@@ -66,12 +66,11 @@ public class PutSortReducer extends
         for (List<Cell> cells: p.getFamilyCellMap().values()) {
           for (Cell cell: cells) {
             KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
-            map.add(kv);
+            if (map.add(kv)) {// don't count duplicated kv into size
+              curSize += kv.heapSize();
+            }
           }
         }
-        for(KeyValue kv: map){
-          curSize +=kv.heapSize();
-        }
       }
       context.setStatus("Read " + map.size() + " entries of " + map.getClass()
           + "(" + StringUtils.humanReadableInt(curSize) + ")");


Mime
View raw message