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

   ## What changes were proposed in this pull request?
   
   `ECKeyOutputStream.ECChunkBuffers.addToDataBuffer` runs once per `write()` 
segment. The `pos <= cellSize` check in it
   built its error message by string concatenation on every call, although the 
check practically never fails. With
   freon's default 4 KB buffer, a 256 MB key makes about 65,000 such calls. On 
a real cluster, building the message took
   0.79% of writer CPU with one `rs-3-2-1024k` writer and 1.81% with 16 writers.
   
   The check now uses Guava's template overload with primitive arguments:
   
   ```java
   Preconditions.checkState(pos <= cellSize, "Position(%s) is greater than the 
cellSize(%s).", pos, cellSize);
   ```
   
   This picks `checkState(boolean, String, int, int)`, so a passing check does 
no string building, boxing or varargs
   allocation. The message is formatted only on failure. Its text and the 
exception type are unchanged.
   `generateParityCells` already uses a template. The eager message in 
`close()` runs once per key and is left as is.
   
   Generated-by: Claude Code (claude-opus-5-5)
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17032
   
   ## How was this patch tested?
   
   No behavior change, so no new test. Existing tests pass: `TestOzoneECClient` 
(35) and `TestECKeyOutputStream` (14).
   Checkstyle is clean.
   
   


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