yihua commented on code in PR #20321:
URL: https://github.com/apache/hudi/pull/20321#discussion_r4287100695
##########
hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileBlock.java:
##########
@@ -126,9 +126,8 @@ protected HFileBlock(HFileContext context,
byteBuff, startOffsetInBuff +
Header.UNCOMPRESSED_SIZE_WITHOUT_HEADER_INDEX);
this.bytesPerChecksum = readInt(
byteBuff, startOffsetInBuff + Header.BYTES_PER_CHECKSUM_INDEX);
- this.sizeCheckSum = bytesPerChecksum > 0
- ? numChecksumBytes(getOnDiskSizeWithHeader(), bytesPerChecksum) : -1;
validateHeader(byteBuff, startOffsetInBuff);
+ this.sizeCheckSum = (int) numChecksumBytes(getOnDiskSizeWithHeader(),
bytesPerChecksum);
Review Comment:
Done. The constructor computes `checksumBytes` once as a `long` (from the
header size plus `onDiskSizeWithoutHeader`, in long math since it runs before
validation), passes it to `validateHeader`, and narrows it into `sizeCheckSum`
after.
--
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]