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/06/05 11:35:19 UTC

[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #1027: HDDS-3734. Improve the performance of SCM with 3.86% by avoid TreeSet.addAll

adoroszlai commented on a change in pull request #1027:
URL: https://github.com/apache/hadoop-ozone/pull/1027#discussion_r435862235



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java
##########
@@ -589,15 +589,15 @@ public boolean getSafeModeStatus() {
    * Query the System for Nodes.
    *
    * @param nodeState - NodeState that we are interested in matching.
-   * @return Set of Datanodes that match the NodeState.
+   * @return List of Datanodes that match the NodeState.
    */
-  private Set<DatanodeDetails> queryNodeState(HddsProtos.NodeState nodeState) {
-    Set<DatanodeDetails> returnSet = new TreeSet<>();
+  private List<DatanodeDetails> queryNodeState(HddsProtos.NodeState nodeState) {
+    List<DatanodeDetails> returnList = new ArrayList<>();
     List<DatanodeDetails> tmp = scm.getScmNodeManager().getNodes(nodeState);
     if ((tmp != null) && (tmp.size() > 0)) {
-      returnSet.addAll(tmp);
+      returnList.addAll(tmp);

Review comment:
       I think `returnList` is no longer needed, `tmp` can be returned from here directly.




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