Meng-Shuan Tsai created HDDS-16202:
--------------------------------------
Summary: 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
{{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{}}}).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]