anoopsjohn commented on a change in pull request #2582:
URL: https://github.com/apache/hbase/pull/2582#discussion_r519602116
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
##########
@@ -554,8 +559,10 @@ protected int blockSeek(Cell key, boolean seekBefore) {
+ " path=" + reader.getPath());
}
offsetFromPos += Bytes.SIZEOF_LONG;
+ rowLen = ((blockBuffer.getByteAfterPosition(offsetFromPos) & 0xff) <<
8)
+ ^ (blockBuffer.getByteAfterPosition(offsetFromPos + 1) & 0xff);
blockBuffer.asSubByteBuffer(blockBuffer.position() + offsetFromPos,
klen, pair);
- bufBackedKeyOnlyKv.setKey(pair.getFirst(), pair.getSecond(), klen);
+ bufBackedKeyOnlyKv.setKey(pair.getFirst(), pair.getSecond(), klen,
(short)rowLen);
Review comment:
I see how the usage is helpful. While seek to a key within the seek
while loop, we decode and keep the state of rowLen. Once seek is done and
called getCell() there we dont have to decode again but reuse the saved state.
make sense. Though I have a comment.
Use BB#getShortAfterPosition() instead of having extra logic here. that
will be even perf wise better both in MBB and SBB
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]