You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "dino2895 (Jira)" <ji...@apache.org> on 2026/08/18 12:43:00 UTC

[jira] [Assigned] (HDDS-16214) Avoid the per-group list copy in KeyManagerImpl read paths

     [ https://issues.apache.org/jira/browse/HDDS-16214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

dino2895 reassigned HDDS-16214:
-------------------------------

    Assignee: dino2895  (was: Huang Kuan Hao)

> Avoid the per-group list copy in KeyManagerImpl read paths
> ----------------------------------------------------------
>
>                 Key: HDDS-16214
>                 URL: https://issues.apache.org/jira/browse/HDDS-16214
>             Project: Apache Ozone
>          Issue Type: Sub-task
>            Reporter: Huang Kuan Hao
>            Assignee: dino2895
>            Priority: Major
>
> Three KeyManagerImpl read-path methods flatten-copy each version group only to iterate/stream it once:
> // addBlockToken4Read
> for (OmKeyLocationInfoGroup key : value.getKeyLocationVersions()) {
>   key.getLocationList().forEach(k -> {
>     k.setToken(secretManager.generateToken(remoteUser, k.getBlockID(),
>         EnumSet.of(READ), k.getLength()));
>   });
> }
> // sortDatanodes
> for (OmKeyLocationInfo k : key.getLocationList()) {
>   Pipeline pipeline = k.getPipeline();
>   ...
> }
> // extractContainerIDs
> return keyInfo.getKeyLocationVersions().stream()
>     .flatMap(v -> v.getLocationList().stream())
>     .map(BlockLocationInfo::getContainerID);
> Fix: iterate getLocationLists() (nested loop / flatMap). setToken mutates the shared element references, so token assignment is unaffected. Behavior unchanged.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org