Skip to content

Commit

Permalink
HBASE-24850 CellComparator perf improvement (#2776)
Browse files Browse the repository at this point in the history
* Using ContiguousCellFormat as a marker alone

* Commit the new file

* Fix the comparator logic that was an oversight

* Fix the sequenceId check order

* Adding few more static methods that helps in scan flow like query
matcher where we have more cols

* Remove ContiguousCellFormat and ensure compare() can be inlined

* applying negation as per review comment

* Fix checkstyle comments

* fix review comments

* Address review comments

Signed-off-by: stack <stack@apache.org>
Signed-off-by: AnoopSamJohn <anoopsamjohn@apache.org>
Signed-off-by: huaxiangsun <huaxiangsun@apache.org>
  • Loading branch information
ramkrish86 committed Dec 28, 2020
1 parent 73b0e8a commit 1c41c97
Show file tree
Hide file tree
Showing 7 changed files with 587 additions and 231 deletions.
173 changes: 0 additions & 173 deletions hbase-common/src/main/java/org/apache/hadoop/hbase/BBKVComparator.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ private int getTimestampOffset() {

@Override
public byte getTypeByte() {
return ByteBufferUtils.toByte(this.buf, this.offset + this.length - 1);
return getTypeByte(this.length);
}

byte getTypeByte(int keyLen) {
return ByteBufferUtils.toByte(this.buf, this.offset + keyLen - 1);
}

@Override
Expand Down Expand Up @@ -236,7 +240,11 @@ public int getFamilyPosition() {

// The position in BB where the family length is added.
private int getFamilyLengthPosition() {
return this.offset + Bytes.SIZEOF_SHORT + getRowLength();
return getFamilyLengthPosition(getRowLength());
}

int getFamilyLengthPosition(int rowLength) {
return this.offset + Bytes.SIZEOF_SHORT + rowLength;
}

@Override
Expand Down

0 comments on commit 1c41c97

Please sign in to comment.