hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-20795 Allow option in BBKVComparator.compare to do comparison without sequence id Signed-off-by: Michael Stack <stack@apache.org>
Date Tue, 26 Jun 2018 23:48:10 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2.1 bd40cba8d -> 5b0eb6d9d


HBASE-20795 Allow option in BBKVComparator.compare to do comparison without sequence id
Signed-off-by: Michael Stack <stack@apache.org>


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

Branch: refs/heads/branch-2.1
Commit: 5b0eb6d9d665a6049624d224209e25868d74a8af
Parents: bd40cba
Author: Ankit Singhal <ankitsinghal59@gmail.com>
Authored: Tue Jun 26 16:46:44 2018 -0700
Committer: Michael Stack <stack@apache.org>
Committed: Tue Jun 26 16:48:04 2018 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/BBKVComparator.java | 7 ++++---
 .../main/java/org/apache/hadoop/hbase/CellComparatorImpl.java | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5b0eb6d9/hbase-common/src/main/java/org/apache/hadoop/hbase/BBKVComparator.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/BBKVComparator.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/BBKVComparator.java
index c15d321..017586d 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/BBKVComparator.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/BBKVComparator.java
@@ -73,7 +73,7 @@ public class BBKVComparator implements Comparator {
   public int compare(Object l, Object r) {
     // LOG.info("ltype={} rtype={}", l, r);
     if ((l instanceof ByteBufferKeyValue) && (r instanceof ByteBufferKeyValue)) {
-      return compare((ByteBufferKeyValue)l, (ByteBufferKeyValue)r);
+      return compare((ByteBufferKeyValue)l, (ByteBufferKeyValue)r, false);
     }
     // Skip calling compare(Object, Object) and go direct to compare(Cell, Cell)
     return this.fallback.compare((Cell)l, (Cell)r);
@@ -81,7 +81,8 @@ public class BBKVComparator implements Comparator {
 
   // TODO: Come back here. We get a few percentage points extra of throughput if this is
a
   // private method.
-  static final int compare(ByteBufferKeyValue left, ByteBufferKeyValue right) {
+  static final int compare(ByteBufferKeyValue left, ByteBufferKeyValue right,
+      boolean ignoreSequenceid) {
     // NOTE: Same method is in CellComparatorImpl, also private, not shared, intentionally.
Not
     // sharing gets us a few percent more throughput in compares. If changes here or there,
make
     // sure done in both places.
@@ -168,6 +169,6 @@ public class BBKVComparator implements Comparator {
     }
 
     // Negate following comparisons so later edits show up first mvccVersion: later sorts
first
-    return Longs.compare(right.getSequenceId(), left.getSequenceId());
+    return ignoreSequenceid ? diff : Longs.compare(right.getSequenceId(), left.getSequenceId());
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/5b0eb6d9/hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparatorImpl.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparatorImpl.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparatorImpl.java
index c2f2ea5..707d919 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparatorImpl.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparatorImpl.java
@@ -74,7 +74,7 @@ public class CellComparatorImpl implements CellComparator {
     int diff = 0;
     // "Peel off" the most common path.
     if (a instanceof ByteBufferKeyValue && b instanceof ByteBufferKeyValue) {
-      diff = BBKVComparator.compare((ByteBufferKeyValue)a, (ByteBufferKeyValue)b);
+      diff = BBKVComparator.compare((ByteBufferKeyValue)a, (ByteBufferKeyValue)b, ignoreSequenceid);
       if (diff != 0) {
         return diff;
       }


Mime
View raw message