Tejaskriya opened a new pull request, #5522:
URL: https://github.com/apache/ozone/pull/5522

   ## What changes were proposed in this pull request?
   
   defaultReadBufferCapacity was changed from long to int in this PR. 
   This change was made because although defaultReadBufferCapacity was long in 
BlockManagerImpl/FilePerBlockStrategy/FilePerChunkStrategy, it was casted to 
int when it is used as shown below.
   ```
   //BufferUtils.assignByteBuffers
       for (int i = 0; i < numBuffers - 1; i++) {
         dataBuffers[i] = ByteBuffer.allocate((int) bufferCapacity);
         buffersAllocated += bufferCapacity;
       }
   ```
   Using long as buffer capacity does NOT work for Java array, Java ByteBuffer, 
Protobuf ByteString and Netty ByteBuf. Moreover, if we set 
ozone.chunk.read.buffer.default.size to "2GB", `((int) bufferCapacity) == 
-2147483648 ` would throw an IllegalArgumentException from 
ByteBuffer.allocate(..).
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-9549
   
   ## How was this patch tested?
   
   Existing tests in TestChunkUtils, TestFilePerBlockStrategy, 
TestFilePerChunkStrategy cover this change
   


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