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

Stephen O'Donnell reassigned HDDS-6334:
---------------------------------------

    Assignee: Stephen O'Donnell

> Remove ContainerID to Proto to ContainerID conversion in 
> ContainerStateManagerImpl
> ----------------------------------------------------------------------------------
>
>                 Key: HDDS-6334
>                 URL: https://issues.apache.org/jira/browse/HDDS-6334
>             Project: Apache Ozone
>          Issue Type: Improvement
>          Components: SCM
>            Reporter: Stephen O'Donnell
>            Assignee: Stephen O'Donnell
>            Priority: Major
>
> In ContainerManagerImpl, most of the methods accept a ContainerID object. 
> This is then converted into `HddsProtos.ContainerID` to pass to 
> ContainerStateManagerImpl. The data is stored in ContainerStateMap, where it 
> is all keyed on ContainerID, so the `HddsProtos.ContainerID` has to be 
> converted back to ContainerID again, which seems wasteful.
> I think this is left over from some previous implementation, but is there 
> there any reason we cannot change ContainerStateManagerImpl to accept 
> ContainerID directly? This is an internal class to ContainerManager, so the 
> change should have minimal impact.
> There are also some TODO's in the code suggesting it was always the intention 
> to make this change, but it never happened, eg:
> {code}
>   @Override
>   public boolean contains(final HddsProtos.ContainerID id) {
>     lock.readLock().lock();
>     try {
>       // TODO: Remove the protobuf conversion after fixing ContainerStateMap.
>       return containers.contains(ContainerID.getFromProtobuf(id));
>     } finally {
>       lock.readLock().unlock();
>     }
>   }
> {code}  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to