Huang Kuan Hao created HDDS-16215:
-------------------------------------

             Summary: Avoid the per-group list copy in 
OmMetadataManagerImpl.getBlocksForKeyDelete
                 Key: HDDS-16215
                 URL: https://issues.apache.org/jira/browse/HDDS-16215
             Project: Apache Ozone
          Issue Type: Sub-task
            Reporter: Huang Kuan Hao
            Assignee: Huang Kuan Hao


getBlocksForKeyDelete flatten-copies each version group only to stream it once 
into DeletedBlock items:

for (OmKeyLocationInfoGroup keyLocations : info.getKeyLocationVersions()) {
  List<DeletedBlock> item = keyLocations.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: keyLocations.getLocationLists().stream().flatMap(List::stream). Behavior 
unchanged.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to