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/08/09 10:00:28 UTC

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

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



##########
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());
+        }
+        if (nodeState != null) {

Review comment:
       we should add a guardrail here to throw exception if the nodeState isn't HEALTHY/STALE/DEAD.




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