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 2021/09/07 17:06:44 UTC

[GitHub] [ozone] errose28 commented on a change in pull request #2406: HDDS-5402 Support list node based on NodeOperationalState and NodeState options in printTopology CLI

errose28 commented on a change in pull request #2406:
URL: https://github.com/apache/ozone/pull/2406#discussion_r703686839



##########
File path: hadoop-ozone/dev-support/intellij/ozone-site.xml
##########
@@ -71,4 +71,4 @@
     <name>datanode.replication.port</name>
     <value>0</value>
   </property>
-</configuration>
+</configuration>

Review comment:
       nit: Can we remove this change since it has no effect and is not related to the task?

##########
File path: hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/TopologySubcommand.java
##########
@@ -76,6 +89,16 @@ public void execute(ScmClient scmClient) throws IOException {
       if (nodes != null && nodes.size() > 0) {
         // show node state
         System.out.println("State = " + state.toString());
+        if (nodeOperationalState != null) {
+          nodes = nodes.stream().filter(
+              info -> info.getNodeOperationalStates(0).toString()
+                  .equals(nodeOperationalState)).collect(Collectors.toList());

Review comment:
       Good idea @jojochuang. Probably want a guard against invalid operational state being passed here too.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

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