orca-07 opened a new pull request, #11082:
URL: https://github.com/apache/ozone/pull/11082

   ## What changes were proposed in this pull request?
   In KeyManagerImpl.getPendingDeletionKeys (the KeyDeletingService 
reclaimable-key scan), each key's DeletedBlock list is built via a flatten-copy 
that is immediately re-streamed and discarded, once per key in the scan:
   
   ```
   List<DeletedBlock> deletedBlocks = info.getKeyLocationVersions().stream()
       .flatMap(versionLocations -> versionLocations.getLocationList().stream()
           .map(b -> new DeletedBlock(
               new BlockID(b.getContainerID(), b.getLocalID()),
               b.getLength(),
               QuotaUtil.getReplicatedSize(b.getLength(), 
info.getReplicationConfig()),
               QuotaUtil.getSizePerReplica(b.getLength(), 
info.getReplicationConfig())
           ))).collect(Collectors.toList());
   ```
   Fix: use `getLocationLists()` (no copy): `.flatMap(v -> 
v.getLocationLists().stream().flatMap(List::stream))`. Behavior unchanged. 
Complementary to 
[HDDS-16195](https://issues.apache.org/jira/browse/HDDS-16195), which reuses 
the computed replicated sizes on the same loop but leaves this copy in place.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16213
   
   ## How was this patch tested?
   
   https://github.com/orca-07/ozone/actions/runs/32501303771
   
   https://github.com/orca-07/ozone/actions/runs/32457228935
   


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