codope commented on code in PR #8526:
URL: https://github.com/apache/hudi/pull/8526#discussion_r1246115508


##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieLogBlock.java:
##########
@@ -264,8 +267,9 @@ public static Option<byte[]> 
tryReadContent(FSDataInputStream inputStream, Integ
 
     // TODO re-use buffer if stream is backed by buffer
     // Read the contents in memory
-    byte[] content = new byte[contentLength];
-    inputStream.readFully(content, 0, contentLength);
+    ValidationUtils.checkArgument(contentLength <= Integer.MAX_VALUE, 
String.format("Content length %d exceeds maximum value of %d", contentLength, 
Integer.MAX_VALUE));

Review Comment:
   What's the point of changing the `contentLength` from int to long type and 
then validating that it's less than Integer.MAX_VALUE?



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to