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

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

> Pipeline.getReplicaIndexes() unnecessarily create a new map
> -----------------------------------------------------------
>
>                 Key: HDDS-16365
>                 URL: https://issues.apache.org/jira/browse/HDDS-16365
>             Project: Apache Ozone
>          Issue Type: Improvement
>          Components: common, OM, Ozone Client
>            Reporter: Tsz-wo Sze
>            Assignee: Tsz-wo Sze
>            Priority: Major
>              Labels: pull-request-available
>
> In Pipeline, the getReplicaIndexes() method, which copies the replicaIndexes 
> map, is not really needed:
> # In many cases, the copied map is used for calling get(dn) -- just directly 
> call the existing getReplicaIndex(dn) method.
> # One special case is in the ScmClient in OM for checking if a pipeline 
> containing all replica indexes -- create a new containsAllReplicaIndexes 
> method.
> # The remaining cases are used in tests for iterating the nodes -- rename it 
> to getReplicaIndexesForTesting() and use unmodifiableMap instead of copying.
> For #1 above, getReplicaIndexes() is mainly used for building DatanodeBlockID 
> protos.  We will also refactor the code:
> - Add a new replicaIdx parameter to 
> BlockID.getDatanodeBlockIDProtobufBuilder().
> - For the code using DatanodeBlockID.Builder, change them to use 
> getDatanodeBlockIDProtobufBuilder(..) instead.



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