tomicooler commented on code in PR #5895:
URL: https://github.com/apache/hadoop/pull/5895#discussion_r1276395283


##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/IFile.java:
##########
@@ -433,8 +434,11 @@ public boolean nextRawKey(DataInputBuffer key) throws 
IOException {
     }
     
     public void nextRawValue(DataInputBuffer value) throws IOException {
+      long targetSizeLong = currentValueLength + (long) (currentValueLength >> 
1);
+      int targetSize = (int) Math.min(targetSizeLong, ARRAY_MAX_SIZE);
+
       final byte[] valBytes = (value.getData().length < currentValueLength)
-        ? new byte[currentValueLength << 1]
+        ? new byte[targetSize]

Review Comment:
   just to be safe, let's keep the doubling but set a max value 
(Integer.MAX_VALUE - 8)



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to