yihua commented on code in PR #20321:
URL: https://github.com/apache/hudi/pull/20321#discussion_r4287242469


##########
hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileBlock.java:
##########
@@ -231,15 +240,12 @@ static int numChecksumBytes(long numBytes, int 
bytesPerChecksum) {
    * @param bytesPerChecksum number of bytes in a checksum chunk.
    * @return the number of checksum chunks.
    */
-  static int numChecksumChunks(long numBytes, int bytesPerChecksum) {
+  static long numChecksumChunks(long numBytes, int bytesPerChecksum) {
     long numChunks = numBytes / bytesPerChecksum;
     if (numBytes % bytesPerChecksum != 0) {
       numChunks++;
     }
-    if (numChunks > Integer.MAX_VALUE / HFileBlock.CHECKSUM_SIZE) {
-      throw new IllegalArgumentException("The number of chunks is too large: " 
+ numChunks);
-    }

Review Comment:
   Right, the guard keeps the byte count under `Integer.MAX_VALUE`, so both 
helpers are now untouched from master. The constructor stores the `int` result 
in a temp, `validateHeader` takes it as a `long`, and the field is assigned 
from the same temp; no casts anywhere.



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