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



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
##########
@@ -790,23 +797,28 @@ public Cell getCell() {
         // we can handle the 'no tags' case.
         if (currTagsLen > 0) {
           ret = new SizeCachedKeyValue(blockBuffer.array(),
-              blockBuffer.arrayOffset() + blockBuffer.position(), cellBufSize, 
seqId);
+              blockBuffer.arrayOffset() + blockBuffer.position(), cellBufSize, 
seqId, currKeyLen,
+              rowLen);
         } else {
           ret = new SizeCachedNoTagsKeyValue(blockBuffer.array(),
-              blockBuffer.arrayOffset() + blockBuffer.position(), cellBufSize, 
seqId);
+              blockBuffer.arrayOffset() + blockBuffer.position(), cellBufSize, 
seqId, currKeyLen,
+              rowLen);
         }
       } else {
         ByteBuffer buf = blockBuffer.asSubByteBuffer(cellBufSize);
         if (buf.isDirect()) {
-          ret = currTagsLen > 0 ? new ByteBufferKeyValue(buf, buf.position(), 
cellBufSize, seqId)
-              : new NoTagsByteBufferKeyValue(buf, buf.position(), cellBufSize, 
seqId);
+          ret = currTagsLen > 0
+              ? new SizeCachedByteBufferKeyValue(buf, buf.position(), 
cellBufSize, seqId,
+                  currKeyLen, rowLen)
+              : new SizeCachedNoTagsByteBufferKeyValue(buf, buf.position(), 
cellBufSize, seqId,
+                  currKeyLen, rowLen);
         } else {
           if (currTagsLen > 0) {
             ret = new SizeCachedKeyValue(buf.array(), buf.arrayOffset() + 
buf.position(),
-                cellBufSize, seqId);
+                cellBufSize, seqId, currKeyLen, rowLen);

Review comment:
       Any advantage we get because of doing here?  Because in one place, while 
constructing this KV objects, we decode the value and set as a state var and 
pass in constructor.  For keyLen, ya we already decoded there (before this 
patch) we pass that for reuse.  But for rowLen its not that way na..  So why to 
change the critical part of HFile reader adding new byte[] state? Better avoid.




----------------------------------------------------------------
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