[
https://issues.apache.org/jira/browse/HDDS-16215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chung-En Lee resolved HDDS-16215.
---------------------------------
Resolution: Fixed
> 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: Sie Yi-Jhen
> Priority: Major
> Labels: pull-request-available
>
> 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]