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

ASF GitHub Bot updated HDDS-8682:
---------------------------------
    Labels: pull-request-available  (was: )

> EC: Avoid O(n) array.remove(element) when filtering pipelines in 
> WritableECContainerProvider
> --------------------------------------------------------------------------------------------
>
>                 Key: HDDS-8682
>                 URL: https://issues.apache.org/jira/browse/HDDS-8682
>             Project: Apache Ozone
>          Issue Type: Sub-task
>          Components: SCM
>            Reporter: Stephen O'Donnell
>            Assignee: Stephen O'Donnell
>            Priority: Major
>              Labels: pull-request-available
>
> When iterating over the pipeline list, if a pipeline is not valid for 
> selection, we call Array.remove(element) to remove it from the list before 
> selecting another random element.
> If the pipeline selection policy could return the array index of the selected 
> pipeline rather than the actual pipeline, then we can use the more efficient 
> Array.remove(index). Even this is still O(n) as the array has to shuffle the 
> elements down the internal array, but it is better than Array.remove(element) 
> as it avoids searching for the element.



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