hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-16139 Use CellUtil instead of KeyValueUtil in Import (NIDHI GAMBHIR)
Date Wed, 29 Jun 2016 09:45:07 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 432868b03 -> 6fb0dd07a


HBASE-16139 Use CellUtil instead of KeyValueUtil in Import (NIDHI GAMBHIR)


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

Branch: refs/heads/master
Commit: 6fb0dd07a81f9e5a109f23c853cd1e0fc1938c2b
Parents: 432868b
Author: tedyu <yuzhihong@gmail.com>
Authored: Wed Jun 29 02:45:00 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Wed Jun 29 02:45:00 2016 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/CellUtil.java        | 4 ++++
 .../main/java/org/apache/hadoop/hbase/mapreduce/Import.java    | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/6fb0dd07/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java
index d9f0679..9162962 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java
@@ -1505,6 +1505,10 @@ public final class CellUtil {
     }
     return new FirstOnRowCell(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
   }
+  
+  public static Cell createFirstOnRow(final byte [] row, int roffset, short rlength) {
+    return new FirstOnRowCell(row, roffset, rlength);
+  }
 
   /**
    * Create a Cell that is smaller than all other possible Cells for the given Cell's row.

http://git-wip-us.apache.org/repos/asf/hbase/blob/6fb0dd07/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
index 7668ac9..c7d5912 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
@@ -209,7 +209,7 @@ public class Import extends Configured implements Tool {
               + Bytes.toString(row.get(), row.getOffset(), row.getLength()));
         }
         if (filter == null
-            || !filter.filterRowKey(KeyValueUtil.createFirstOnRow(row.get(), row.getOffset(),
+            || !filter.filterRowKey(CellUtil.createFirstOnRow(row.get(), row.getOffset(),
                 (short) row.getLength()))) {
           for (Cell kv : value.rawCells()) {
             kv = filterKv(filter, kv);
@@ -275,7 +275,7 @@ public class Import extends Configured implements Tool {
               + Bytes.toString(row.get(), row.getOffset(), row.getLength()));
         }
         if (filter == null
-            || !filter.filterRowKey(KeyValueUtil.createFirstOnRow(row.get(), row.getOffset(),
+            || !filter.filterRowKey(CellUtil.createFirstOnRow(row.get(), row.getOffset(),
                 (short) row.getLength()))) {
           for (Cell kv : value.rawCells()) {
             kv = filterKv(filter, kv);
@@ -332,7 +332,7 @@ public class Import extends Configured implements Tool {
             + Bytes.toString(key.get(), key.getOffset(), key.getLength()));
       }
       if (filter == null
-          || !filter.filterRowKey(KeyValueUtil.createFirstOnRow(key.get(), key.getOffset(),
+          || !filter.filterRowKey(CellUtil.createFirstOnRow(key.get(), key.getOffset(),
               (short) key.getLength()))) {
         processKV(key, result, context, put, delete);
       }


Mime
View raw message