Skip to content

Commit 9419723

Browse files
committed
HBASE-29995 Use assembleCrossingLE method in get method
1 parent 3a27bfc commit 9419723

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

hbase-common/src/main/java/org/apache/hadoop/hbase/util/RowColBloomHashKey.java

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -47,39 +47,7 @@ public RowColBloomHashKey(Cell cell) {
4747

4848
@Override
4949
public byte get(int offset) {
50-
// ROWCOL Bloom byte layout:
51-
// <2B RK length> <RK> <1B CF length> <CQ> <8B TS> <1B TYPE>
52-
if (offset < Bytes.SIZEOF_SHORT) {
53-
// assign locally
54-
int rowlen = rowLength;
55-
byte b = (byte) rowlen;
56-
if (offset == 0) {
57-
rowlen >>= 8;
58-
b = (byte) rowlen;
59-
}
60-
return b;
61-
}
62-
int refLen = Bytes.SIZEOF_SHORT + rowLength;
63-
if (offset < refLen) {
64-
return PrivateCellUtil.getRowByte(t, offset - Bytes.SIZEOF_SHORT);
65-
}
66-
if (offset == refLen) {
67-
// The fam length should return 0 assuming there is no column family.
68-
// Because for ROWCOL blooms family is not considered
69-
return 0;
70-
}
71-
refLen += qualLength + Bytes.SIZEOF_BYTE;
72-
// skip the family len because actual cells may have family also
73-
if (offset < refLen) {
74-
return PrivateCellUtil.getQualifierByte(t,
75-
offset - (Bytes.SIZEOF_SHORT + rowLength + Bytes.SIZEOF_BYTE));
76-
}
77-
// TODO : check if ts and type can be removed
78-
refLen += KeyValue.TIMESTAMP_SIZE;
79-
if (offset < refLen) {
80-
return LATEST_TS[offset - (Bytes.SIZEOF_SHORT + rowLength + qualLength + Bytes.SIZEOF_BYTE)];
81-
}
82-
return MAX_TYPE;
50+
return (byte) assembleCrossingLE(offset, Bytes.SIZEOF_BYTE);
8351
}
8452

8553
@Override

0 commit comments

Comments
 (0)