[
https://issues.apache.org/jira/browse/HDDS-6334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated HDDS-6334:
---------------------------------
Labels: pull-request-available (was: )
> 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
> Labels: pull-request-available
>
> 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]