ramkrish86 commented on a change in pull request #2582:
URL: https://github.com/apache/hbase/pull/2582#discussion_r517935274



##########
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:
       IMO the rowLen is anyway getting decoded in the setKey method. And the 
same we can reuse and have it for rowLen. So I think it is better to have it 
decoded earlier. Because that rowLen decoding is happening per cell. 




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to