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

   ## What changes were proposed in this pull request?
   
   While building the reclaimable-key list, `KeyManagerImpl` already computes 
and stores each block's replicated size in `DeletedBlock`. It then traverses 
the key locations again through `OMKeyRequest.sumBlockLengths()` to recompute 
the same values for `PurgedKey`.
   
   This change calculates `purgedBytes` from the `DeletedBlock` values already 
produced. It avoids another traversal of the key-location groups, their 
flattened-list allocations, and repeated `QuotaUtil.getReplicatedSize()` calls.
   
   The resulting quota value and behavior are unchanged.
   
   This complements HDDS-16183: that change improves `sumBlockLengths()` for 
its remaining callers, while this change removes a redundant call from the 
pending-deletion scan. The patches touch different files and can be merged 
independently.
   
   ## What is the link to the Apache JIRA?
   
   https://issues.apache.org/jira/browse/HDDS-16195
   
   ## How was this patch tested?
   
   Added `checkPurgedBytesMatchBlocksQueuedForDeletion`, which creates a 
versioned key spanning two location groups and verifies that `purgedBytes` 
equals the replicated-size sum of the blocks queued for deletion.
   
   The targeted test passed:
   
   - 
`TestKeyDeletingService$Normal#checkPurgedBytesMatchBlocksQueuedForDeletion`
   
   Checkstyle reports no errors for the changed files.
   
   Generated-by: Claude Code (Opus 5)
   


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