hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [26/50] [abbrv] hbase git commit: HBASE-16659 Use CellUtil.createFirstOnRow instead of KeyValueUtil.createFirstOnRow in some places (binlijin)
Date Thu, 22 Sep 2016 16:34:14 GMT
HBASE-16659 Use CellUtil.createFirstOnRow instead of KeyValueUtil.createFirstOnRow in some
places (binlijin)


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

Branch: refs/heads/hbase-14439
Commit: c67983ebf88d449a67bccd8b213237362a4093f6
Parents: 6624c67
Author: chenheng <chenheng@apache.org>
Authored: Wed Sep 21 15:25:36 2016 +0800
Committer: chenheng <chenheng@apache.org>
Committed: Wed Sep 21 15:25:36 2016 +0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java   | 4 ++--
 .../org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java   | 4 ++--
 .../java/org/apache/hadoop/hbase/regionserver/HRegion.java    | 2 +-
 .../hadoop/hbase/regionserver/ReversedRegionScannerImpl.java  | 7 ++-----
 .../apache/hadoop/hbase/regionserver/StoreFileScanner.java    | 3 ++-
 5 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c67983eb/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java
index 54402ef..f52137d 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java
@@ -25,7 +25,7 @@ import java.util.PriorityQueue;
 
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellComparator;
-import org.apache.hadoop.hbase.KeyValueUtil;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
@@ -175,7 +175,7 @@ public class FuzzyRowFilter extends FilterBase {
       return null;
     }
     byte[] nextRowKey = tracker.nextRow();
-    return KeyValueUtil.createFirstOnRow(nextRowKey);
+    return CellUtil.createFirstOnRow(nextRowKey, 0, (short) nextRowKey.length);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/c67983eb/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
index 3f26586..33f035c 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
@@ -25,7 +25,6 @@ import java.util.List;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.KeyValueUtil;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
@@ -138,7 +137,8 @@ public class MultiRowRangeFilter extends FilterBase {
   @Override
   public Cell getNextCellHint(Cell currentKV) {
     // skip to the next range's start row
-    return KeyValueUtil.createFirstOnRow(range.startRow);
+    return CellUtil.createFirstOnRow(range.startRow, 0,
+        (short) range.startRow.length);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/c67983eb/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index 351a389..debaec9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -6216,7 +6216,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver,
Regi
       }
       boolean result = false;
       startRegionOperation();
-      KeyValue kv = KeyValueUtil.createFirstOnRow(row);
+      Cell kv = CellUtil.createFirstOnRow(row, 0, (short) row.length);
       try {
         // use request seek to make use of the lazy seek option. See HBASE-5520
         result = this.storeHeap.requestSeek(kv, true, true);

http://git-wip-us.apache.org/repos/asf/hbase/blob/c67983eb/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedRegionScannerImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedRegionScannerImpl.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedRegionScannerImpl.java
index 5224b8c..487375a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedRegionScannerImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedRegionScannerImpl.java
@@ -21,10 +21,9 @@ package org.apache.hadoop.hbase.regionserver;
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
-import org.apache.hadoop.hbase.KeyValueUtil;
+import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.regionserver.HRegion.RegionScannerImpl;
 
@@ -67,9 +66,7 @@ class ReversedRegionScannerImpl extends RegionScannerImpl {
   protected boolean nextRow(ScannerContext scannerContext, Cell curRowCell)
       throws IOException {
     assert super.joinedContinuationRow == null : "Trying to go to next row during joinedHeap
read.";
-    byte[] row = new byte[curRowCell.getRowLength()];
-    CellUtil.copyRowTo(curRowCell, row, 0);
-    this.storeHeap.seekToPreviousRow(KeyValueUtil.createFirstOnRow(row));
+    this.storeHeap.seekToPreviousRow(CellUtil.createFirstOnRow(curRowCell));
     resetFilters();
     // Calling the hook in CP which allows it to do a fast forward
     if (this.region.getCoprocessorHost() != null) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/c67983eb/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
index a07de54..52811f6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
@@ -506,7 +506,8 @@ public class StoreFileScanner implements KeyValueScanner {
     if (lastRow == null) {
       return false;
     }
-    KeyValue seekKey = KeyValueUtil.createFirstOnRow(lastRow);
+    Cell seekKey = CellUtil
+        .createFirstOnRow(lastRow, 0, (short) lastRow.length);
     if (seek(seekKey)) {
       return true;
     } else {


Mime
View raw message