wenwj0 commented on code in PR #4502:
URL: https://github.com/apache/hbase/pull/4502#discussion_r917869794


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java:
##########
@@ -625,11 +625,12 @@ HFileBlock unpack(HFileContext fileContext, FSReader 
reader) throws IOException
         : reader.getDefaultBlockDecodingContext();
       // Create a duplicated buffer without the header part.
       ByteBuff dup = this.buf.duplicate();
-      dup.position(this.headerSize());
+      int totalChecksumBytes = totalChecksumBytes();
+      dup.position(this.headerSize()).limit(dup.limit() - totalChecksumBytes);
       dup = dup.slice();
       // Decode the dup into unpacked#buf
-      ctx.prepareDecoding(unpacked.getOnDiskSizeWithoutHeader(),
-        unpacked.getUncompressedSizeWithoutHeader(), 
unpacked.getBufferWithoutHeader(true), dup);
+      ctx.prepareDecoding(unpacked.getOnDiskSizeWithoutHeader() - 
totalChecksumBytes,

Review Comment:
   I want to know why `unpacked.getBufferWithoutHeader(true)` is set as true, 
Is this checkSum bytes used in somewhere? 



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to