slfan1989 commented on code in PR #5766:
URL: https://github.com/apache/hadoop/pull/5766#discussion_r1239637939


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestRouterCLI.java:
##########
@@ -120,7 +122,10 @@ public void testDeregisterSubCluster() throws Exception {
     ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
     System.setOut(new PrintStream(dataOut));
     oldOutPrintStream.println(dataOut);
-    String[] args = {"-deregisterSubCluster", "-c", "SC-1"};
+    String[] args = {"-deregisterSubCluster", "-sc", "SC-1"};

Review Comment:
   Apologies for the oversight. In the command, we wrote `-sc` as the option, 
but the actual input requires `-c`.
   
   RouterCLI#ADMIN_USAGE
   ```
   protected final static Map<String, UsageInfo> ADMIN_USAGE =
         ImmutableMap.<String, UsageInfo>builder().put("-deregisterSubCluster",
           new UsageInfo("[-sc|subClusterId [subCluster id]]",
           "deregister subCluster, if the interval between the heartbeat time 
of the subCluster " 
   ```
   
   RouterCLI#handleDeregisterSubCluster
   ```
   Options opts = new Options();
       opts.addOption("deregisterSubCluster", false,
           "Refresh the hosts information at the ResourceManager.");
       Option gracefulOpt = new Option("c", "clusterId", true,
           "Wait for timeout before marking the NodeManager as 
decommissioned.");
       gracefulOpt.setOptionalArg(true);
       opts.addOption(gracefulOpt);
   ```
   
   In this pr, I have fixed this issue by allowing the use of `-sc` or 
`--subClusterId` to specify the subCluster.
   
   Cmd1 : `yarn routeradmin -deregisterSubCluster`
   
   <img width="1089" alt="image" 
src="https://github.com/apache/hadoop/assets/55643692/e7fcf521-0ca3-4717-8110-1ad8f20916cd";>
   
   Cmd2 : `yarn routeradmin -deregisterSubCluster -sc ClusterTest-Yarn1`
   
   <img width="1078" alt="image" 
src="https://github.com/apache/hadoop/assets/55643692/5993e329-c41e-4378-b1d4-8d751fff6140";>
   
   Cmd3 :`yarn routeradmin -deregisterSubCluster --subClusterId 
ClusterTest-Yarn1`
   
   <img width="1109" alt="image" 
src="https://github.com/apache/hadoop/assets/55643692/43824c44-b0fb-4a97-a1c6-a83804ec9961";>
   
   
   



-- 
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: common-issues-unsubscr...@hadoop.apache.org

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


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

Reply via email to