You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/12/01 10:44:00 UTC

[GitHub] [ozone] sodonnel commented on a change in pull request #1610: HDDS-4473. Reduce number of sortDatanodes RPC calls

sodonnel commented on a change in pull request #1610:
URL: https://github.com/apache/ozone/pull/1610#discussion_r533310687



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
##########
@@ -2322,21 +2322,22 @@ void sortDatanodes(String clientMachine, OmKeyInfo... keyInfos) {
         }
         for (OmKeyLocationInfo k : key.getLocationList()) {
           Pipeline pipeline = k.getPipeline();
-          PipelineID pipelineId = pipeline.getId();
-          List<DatanodeDetails> sortedNodes = sortedPipelines.get(pipelineId);
+          List<DatanodeDetails> nodes = pipeline.getNodes();
+          List<String> uuidList = toNodeUuid(nodes);
+          Set<String> uuidSet = new HashSet<>(uuidList);

Review comment:
       Do you think it would be better to return a Set<String> directly in toNodeUuid(...), rather than return a list and then create a set from it? Its a tiny optimisation but I don't think we really need the intermediate list - its just used in the log message later and we can probably just use "nodes" rather than nodeList in the log as it was before.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org