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

   ## What changes were proposed in this pull request?
   
   `ListIterator.HeapEntry.compareTo` builds a new composed `Comparator` on 
every call. `HeapEntry` is the element type of the `PriorityQueue<HeapEntry>` 
min-heap that merges the cache and table iterators for `listStatus`, so 
draining a listing of N entries allocates a fresh comparator (a couple of 
short-lived objects) on each of the O(N log N) comparisons.
   
   This hoists the comparator to a `private static final Comparator<HeapEntry>` 
constant so it is built once instead of per comparison, and switches the 
secondary key to `thenComparingInt` since `getEntryIteratorId()` returns an 
`int` (which also avoids the per-comparison `Integer` boxing of 
`thenComparing`). The ordering is unchanged, so the change is 
behavior-preserving.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16310
   
   ## How was this patch tested?
   
   Behavior-preserving refactor with no functional change, so no new test is 
added; the min-heap `compareTo` path is exercised by the existing `listStatus` 
coverage.
   
   - Unit: `mvn -pl :ozone-manager test -Dtest=TestKeyManagerUnit` — 10 run, 0 
failed
   - `checkstyle` and `pmd` clean
   - Full CI green on the fork branch (basic checks, integration, and 
acceptance): https://github.com/rich7420/ozone/actions/runs/33090788532
   
   Generated-by: Claude Code (Claude Opus 4.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