[ 
https://issues.apache.org/jira/browse/YARN-11517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17736441#comment-17736441
 ] 

ASF GitHub Bot commented on YARN-11517:
---------------------------------------

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





> Improve Federation#RouterCLI deregisterSubCluster Code
> ------------------------------------------------------
>
>                 Key: YARN-11517
>                 URL: https://issues.apache.org/jira/browse/YARN-11517
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: federation, router
>            Reporter: Shilun Fan
>            Assignee: Shilun Fan
>            Priority: Major
>              Labels: pull-request-available
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to