Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-24850 CellComparator perf improvement #2776

Merged
merged 10 commits into from
Dec 28, 2020
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