You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Stephen O'Donnell (Jira)" <ji...@apache.org> on 2022/02/16 20:07:00 UTC

[jira] [Created] (HDDS-6334) Remove ContainerID to Proto to ContainerID conversion in ContainerStateManagerImpl

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

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


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: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org