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


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RouterCLI.java:
##########
@@ -77,25 +79,70 @@ public class RouterCLI extends Configured implements Tool {
 
   private static final Logger LOG = LoggerFactory.getLogger(RouterCLI.class);
 
-  protected final static Map<String, UsageInfo> ADMIN_USAGE =
-      ImmutableMap.<String, UsageInfo>builder()
-         // Command1: deregisterSubCluster
-        .put("-deregisterSubCluster", new UsageInfo(
-        "[-sc|--subClusterId [subCluster Id]]",
-        "Deregister SubCluster, If the interval between the heartbeat time of 
the subCluster " +
-        "and the current time exceeds the timeout period, " +
-        "set the state of the subCluster to SC_LOST."))
-         // Command2: policy
-        .put("-policy", new UsageInfo(
-        "[-s|--save [queue;router weight;amrm weight;headroomalpha]] " +
-         "[-bs|--batch-save [--format xml] [-f|--input-file fileName]]" +
-         "[-l|--list [--pageSize][--currentPage][--queue][--queues]]",
-        "We provide a set of commands for Policy:" +
-        " Include list policies, save policies, batch save policies. " +
-        " (Note: The policy type will be directly read from the" +
-        " yarn.federation.policy-manager in the local yarn-site.xml.)" +
-        " eg. (routeradmin -policy [-s|--save] 
root.a;SC-1:0.7,SC-2:0.3;SC-1:0.7,SC-2:0.3;1.0)"))
-        .build();
+  protected final static UsageInfo SUBCLUSTER_ID = new 
UsageInfo("<-sc|--subClusterId>",
+      "'-sc' option allows you to specify the sub-cluster to operate on, " +
+      "while the '--subClusterId' option is the long format of -sc and serves 
the same purpose.");
+  protected final static String DSEXAMPLE_1 = "yarn routeradmin 
-deregisterSubCluster -sc SC-1";
+  protected final static String DSEXAMPLE_2 = "yarn routeradmin 
-deregisterSubCluster --subClusterId SC-1";
+
+  protected final static RouterExampleUsageInfos DSEXAMPLEUSAGEINFOS_1 = new 
RouterExampleUsageInfos(
+          Arrays.asList(DSEXAMPLE_1, DSEXAMPLE_2),
+          Arrays.asList("At this point we can use the following command:"));
+  protected final static RouterUsageInfos DEREGISTER_SUBCLUSTER =
+      new RouterUsageInfos(Arrays.asList(SUBCLUSTER_ID),
+      Arrays.asList("deregister subCluster, " +

Review Comment:
   Thanks for your feedback! I will improve this part of the code to make it 
more readable.



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