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

   ## What changes were proposed in this pull request?
   
   `S3MultipartUploadCompleteRequest` collects the requested part numbers into 
an `ArrayList`, then for every uploaded part calls `partNumbers.contains(...)` 
to find the unused parts to clean up. S3 allows up to 10000 parts, so this 
lookup is `O(n*m)` with `Integer` autoboxing, and it runs while the bucket 
write lock is held.
   
   This switches `partNumbers` to a `HashSet` (and the matching 
`getPartsListSize` parameter type), making the unused-part lookup `O(1)` per 
part. `partNumbers` is only ever `add`-ed and `contains`-probed, and the 
strict-increasing part order is validated independently in `getPartsListSize`, 
so it does not depend on list ordering. Behavior is unchanged.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16311
   
   ## How was this patch tested?
   
   Behavior-preserving change with no functional difference, so no new test is 
added; the affected paths (part-order validation and the unused-part lookup) 
are covered by the existing tests.
   
   - Unit: `mvn -pl :ozone-manager test 
-Dtest=TestS3MultipartUploadCompleteRequest,TestS3MultipartUploadCompleteRequestWithFSO`
 — 16 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/33089595241
   


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