Tsz-wo Sze created HDDS-2270:
--------------------------------

             Summary: Avoid buffer copying in 
ContainerStateMachine.loadSnapshot/persistContainerSet
                 Key: HDDS-2270
                 URL: https://issues.apache.org/jira/browse/HDDS-2270
             Project: Hadoop Distributed Data Store
          Issue Type: Improvement
          Components: Ozone Datanode
            Reporter: Tsz-wo Sze
            Assignee: Tsz-wo Sze


ContainerStateMachine:
- In loadSnapshot(..), it first reads the snapshotFile to a  byte[] and then 
parses it to ContainerProtos.Container2BCSIDMapProto.  The buffer copying can 
be avoided.
{code}
    try (FileInputStream fin = new FileInputStream(snapshotFile)) {
      byte[] container2BCSIDData = IOUtils.toByteArray(fin);
      ContainerProtos.Container2BCSIDMapProto proto =
          ContainerProtos.Container2BCSIDMapProto
              .parseFrom(container2BCSIDData);
      ...
    }
{code}

- persistContainerSet(..) has similar problem.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to