whutjs opened a new pull request #9723: Fix misuse of Integer.SIZE in 
FileWriteOutBytes.writeInt
URL: https://github.com/apache/druid/pull/9723
 
 
   ### Description
   
   In the `FileWriteOutBytes#writeInt(int)` method, the argument passed to 
`flushIfNeeded()` is `Integer.SIZE` while the `Integer.BYTES` should be used.  
   
   **Problem**
   This bug will incur one extra file write operation in some cases.  For 
example, if we would like to write 4 KB of ints using 
`FileWriteOutBytes#writeInt(int)`, the `flush()` method will be called twice.  
After fixing this bug, the `flush()` method will be called only one.
   
   
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added unit tests or modified existing tests to cover new code paths.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `FileWriteOutBytes`
    * `FileWriteOutBytesTest`
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to