[
https://issues.apache.org/jira/browse/HDDS-8682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stephen O'Donnell resolved HDDS-8682.
-------------------------------------
Fix Version/s: 1.4.0
Resolution: Fixed
> 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
> Fix For: 1.4.0
>
>
> 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]