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

[jira] [Updated] (HDDS-16202) Avoid the list copy in ContainerEndpoint.getBlocks

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

Meng-Shuan Tsai updated HDDS-16202:
-----------------------------------
    Description: 
{{ContainerEndpoint.getBlocks}} only keeps blocks whose containerID matches the request, but it calls {{getLocationList()}} and then {{{}filter().collect(){}}}, allocating two lists it does not keep. {{getLocationList()}} is documented as not O(1); {{getLocationLists()}} returns {{locationVersionMap.values()}} with no copy.

Iterate {{getLocationLists()}} and add matching blocks. Behavior unchanged.

Related: HDDS-16183 (same pattern in {{{}sumBlockLengths{}}}).

  was:
{{ContainerEndpoint.getBlocks}} ({{{}GET /api/v1/containers/:id/keys{}}}) only keeps blocks whose containerID matches the request, but it calls {{getLocationList()}} and then {{{}filter().collect(){}}}, allocating two lists it does not keep. {{getLocationList()}} is documented as not O(1); {{getLocationLists()}} returns {{locationVersionMap.values()}} with no copy.

Iterate {{getLocationLists()}} and add matching blocks. Behavior unchanged.

Related: HDDS-16183 (same pattern in {{{}sumBlockLengths{}}}).


> Avoid the list copy in ContainerEndpoint.getBlocks
> --------------------------------------------------
>
>                 Key: HDDS-16202
>                 URL: https://issues.apache.org/jira/browse/HDDS-16202
>             Project: Apache Ozone
>          Issue Type: Improvement
>            Reporter: Meng-Shuan Tsai
>            Assignee: Meng-Shuan Tsai
>            Priority: Major
>
> {{ContainerEndpoint.getBlocks}} only keeps blocks whose containerID matches the request, but it calls {{getLocationList()}} and then {{{}filter().collect(){}}}, allocating two lists it does not keep. {{getLocationList()}} is documented as not O(1); {{getLocationLists()}} returns {{locationVersionMap.values()}} with no copy.
> Iterate {{getLocationLists()}} and add matching blocks. Behavior unchanged.
> Related: HDDS-16183 (same pattern in {{{}sumBlockLengths{}}}).



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