hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsamj...@apache.org
Subject git commit: HBASE-11872 Avoid usage of KeyValueUtil#ensureKeyValue from Compactor.
Date Mon, 22 Sep 2014 04:56:18 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 f5305c603 -> ee5978d8f


HBASE-11872 Avoid usage of KeyValueUtil#ensureKeyValue from Compactor.


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

Branch: refs/heads/branch-1
Commit: ee5978d8f01169d5f1f24556eace371c6b2adec6
Parents: f5305c6
Author: anoopsjohn <anoopsamjohn@gmail.com>
Authored: Mon Sep 22 10:25:51 2014 +0530
Committer: anoopsjohn <anoopsamjohn@gmail.com>
Committed: Mon Sep 22 10:25:51 2014 +0530

----------------------------------------------------------------------
 .../regionserver/compactions/Compactor.java     | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ee5978d8/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/Compactor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/Compactor.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/Compactor.java
index 6e06e5b..3b1e363 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/Compactor.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/Compactor.java
@@ -30,7 +30,6 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValueUtil;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.io.compress.Compression;
@@ -232,7 +231,7 @@ public abstract class Compactor {
     int bytesWritten = 0;
     // Since scanner.next() can return 'false' but still be delivering data,
     // we have to use a do/while loop.
-    List<Cell> kvs = new ArrayList<Cell>();
+    List<Cell> cells = new ArrayList<Cell>();
     int closeCheckInterval = HStore.getCloseCheckInterval();
     long lastMillis;
     if (LOG.isDebugEnabled()) {
@@ -242,20 +241,19 @@ public abstract class Compactor {
     }
     boolean hasMore;
     do {
-      hasMore = scanner.next(kvs, compactionKVMax);
+      hasMore = scanner.next(cells, compactionKVMax);
       // output to writer:
-      for (Cell c : kvs) {
-        KeyValue kv = KeyValueUtil.ensureKeyValue(c);
-        if (cleanSeqId && kv.getSequenceId() <= smallestReadPoint) {
-          CellUtil.setSequenceId(kv, 0);
+      for (Cell c : cells) {
+        if (cleanSeqId && c.getSequenceId() <= smallestReadPoint) {
+          CellUtil.setSequenceId(c, 0);
         }
-        writer.append(kv);
+        writer.append(c);
         ++progress.currentCompactedKVs;
-        progress.totalCompactedSize += kv.getLength();
+        progress.totalCompactedSize += KeyValueUtil.length(c);
 
         // check periodically to see if a system stop is requested
         if (closeCheckInterval > 0) {
-          bytesWritten += kv.getLength();
+          bytesWritten += KeyValueUtil.length(c);
           if (bytesWritten > closeCheckInterval) {
             // Log the progress of long running compactions every minute if
             // logging at DEBUG level
@@ -275,7 +273,7 @@ public abstract class Compactor {
           }
         }
       }
-      kvs.clear();
+      cells.clear();
     } while (hasMore);
     progress.complete();
     return true;


Mime
View raw message