[ 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to