Browse Source

YARN-3581. Deprecate -directlyAccessNodeLabelStore in RMAdminCLI. (Naganarasimha G R via wangda)

Wangda Tan 10 years ago
parent
commit
cab7674e54

+ 3 - 0
hadoop-yarn-project/CHANGES.txt

@@ -268,6 +268,9 @@ Release 2.8.0 - UNRELEASED
     YARN-3647. RMWebServices api's should use updated api from CommonNodeLabelsManager 
     to get NodeLabel object. (Sunil G via wangda)
 
+    YARN-3581. Deprecate -directlyAccessNodeLabelStore in RMAdminCLI. 
+    (Naganarasimha G R via wangda)
+
   OPTIMIZATIONS
 
     YARN-3339. TestDockerContainerExecutor should pull a single image and not

+ 1 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/ClusterCLI.java

@@ -73,7 +73,7 @@ public class ClusterCLI extends YarnCLI {
         "List cluster node-label collection");
     opts.addOption("h", HELP_CMD, false, "Displays help for all commands.");
     opts.addOption("dnl", DIRECTLY_ACCESS_NODE_LABEL_STORE, false,
-        "Directly access node label store, "
+        "This is DEPRECATED, will be removed in future releases. Directly access node label store, "
             + "with this option, all node label related operations"
             + " will NOT connect RM. Instead, they will"
             + " access/modify stored node labels directly."

+ 13 - 9
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java

@@ -109,20 +109,20 @@ public class RMAdminCLI extends HAAdmin {
           .put("-getGroups", new UsageInfo("[username]",
               "Get the groups which given user belongs to."))
           .put("-addToClusterNodeLabels",
-              new UsageInfo("[label1(exclusive=true),"
-                  + "label2(exclusive=false),label3]",
-                  "add to cluster node labels "))
+              new UsageInfo("<\"label1(exclusive=true),"
+                  + "label2(exclusive=false),label3\">",
+                  "add to cluster node labels. Default exclusivity is true"))
           .put("-removeFromClusterNodeLabels",
-              new UsageInfo("[label1,label2,label3] (label splitted by \",\")",
+              new UsageInfo("<label1,label2,label3> (label splitted by \",\")",
                   "remove from cluster node labels"))
           .put("-replaceLabelsOnNode",
               new UsageInfo(
-                  "[node1[:port]=label1,label2 node2[:port]=label1,label2]",
+                  "<\"node1[:port]=label1,label2 node2[:port]=label1,label2\">",
                   "replace labels on nodes"
                       + " (please note that we do not support specifying multiple"
                       + " labels on a single host for now.)"))
           .put("-directlyAccessNodeLabelStore",
-              new UsageInfo("", "Directly access node label store, "
+              new UsageInfo("", "This is DEPRECATED, will be removed in future releases. Directly access node label store, "
                   + "with this option, all node label related operations"
                   + " will not connect RM. Instead, they will"
                   + " access/modify stored node labels directly."
@@ -222,9 +222,10 @@ public class RMAdminCLI extends HAAdmin {
       " [-refreshAdminAcls]" +
       " [-refreshServiceAcl]" +
       " [-getGroup [username]]" +
-      " [[-addToClusterNodeLabels [label1,label2,label3]]" +
-      " [-removeFromClusterNodeLabels [label1,label2,label3]]" +
-      " [-replaceLabelsOnNode [node1[:port]=label1,label2 node2[:port]=label1]" +
+      " [-addToClusterNodeLabels <\"label1(exclusive=true),"
+                  + "label2(exclusive=false),label3\">]" +
+      " [-removeFromClusterNodeLabels <label1,label2,label3>]" +
+      " [-replaceLabelsOnNode <\"node1[:port]=label1,label2 node2[:port]=label1\">]" +
       " [-directlyAccessNodeLabelStore]]");
     if (isHAEnabled) {
       appendHAUsage(summary);
@@ -681,6 +682,7 @@ public class RMAdminCLI extends HAAdmin {
       } else if ("-addToClusterNodeLabels".equals(cmd)) {
         if (i >= args.length) {
           System.err.println(NO_LABEL_ERR_MSG);
+          printUsage("", isHAEnabled);
           exitCode = -1;
         } else {
           exitCode = addToClusterNodeLabels(args[i]);
@@ -688,6 +690,7 @@ public class RMAdminCLI extends HAAdmin {
       } else if ("-removeFromClusterNodeLabels".equals(cmd)) {
         if (i >= args.length) {
           System.err.println(NO_LABEL_ERR_MSG);
+          printUsage("", isHAEnabled);
           exitCode = -1;
         } else {
           exitCode = removeFromClusterNodeLabels(args[i]);
@@ -695,6 +698,7 @@ public class RMAdminCLI extends HAAdmin {
       } else if ("-replaceLabelsOnNode".equals(cmd)) {
         if (i >= args.length) {
           System.err.println(NO_MAPPING_ERR_MSG);
+          printUsage("", isHAEnabled);
           exitCode = -1;
         } else {
           exitCode = replaceLabelsOnNodes(args[i]);

+ 3 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestClusterCLI.java

@@ -137,7 +137,9 @@ public class TestClusterCLI {
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     PrintWriter pw = new PrintWriter(baos);
     pw.println("usage: yarn cluster");
-    pw.println(" -dnl,--directly-access-node-label-store   Directly access node label");
+    pw.println(" -dnl,--directly-access-node-label-store   This is DEPRECATED, will be");
+    pw.println("                                           removed in future releases.");
+    pw.println("                                           Directly access node label");
     pw.println("                                           store, with this option, all");
     pw.println("                                           node label related operations");
     pw.println("                                           will NOT connect RM. Instead,");

+ 7 - 6
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestRMAdminCLI.java

@@ -333,9 +333,9 @@ public class TestRMAdminCLI {
               "yarn rmadmin [-refreshQueues] [-refreshNodes [-g [timeout in seconds]]] [-refreshSuper" +
               "UserGroupsConfiguration] [-refreshUserToGroupsMappings] " +
               "[-refreshAdminAcls] [-refreshServiceAcl] [-getGroup" +
-              " [username]] [[-addToClusterNodeLabels [label1,label2,label3]]" +
-              " [-removeFromClusterNodeLabels [label1,label2,label3]] [-replaceLabelsOnNode " +
-              "[node1[:port]=label1,label2 node2[:port]=label1] [-directlyAccessNodeLabelStore]] " +
+              " [username]] [-addToClusterNodeLabels <\"label1(exclusive=true),label2(exclusive=false),label3\">]" +
+              " [-removeFromClusterNodeLabels <label1,label2,label3>] [-replaceLabelsOnNode " +
+              "<\"node1[:port]=label1,label2 node2[:port]=label1\">] [-directlyAccessNodeLabelStore]] " +
               "[-help [cmd]]"));
       assertTrue(dataOut
           .toString()
@@ -413,9 +413,10 @@ public class TestRMAdminCLI {
           "yarn rmadmin [-refreshQueues] [-refreshNodes [-g [timeout in seconds]]] [-refreshSuper"
               + "UserGroupsConfiguration] [-refreshUserToGroupsMappings] "
               + "[-refreshAdminAcls] [-refreshServiceAcl] [-getGroup"
-              + " [username]] [[-addToClusterNodeLabels [label1,label2,label3]]"
-              + " [-removeFromClusterNodeLabels [label1,label2,label3]] [-replaceLabelsOnNode "
-              + "[node1[:port]=label1,label2 node2[:port]=label1] [-directlyAccessNodeLabelStore]] "
+              + " [username]] [-addToClusterNodeLabels <\"label1(exclusive=true),"
+                  + "label2(exclusive=false),label3\">]"
+              + " [-removeFromClusterNodeLabels <label1,label2,label3>] [-replaceLabelsOnNode "
+              + "<\"node1[:port]=label1,label2 node2[:port]=label1\">] [-directlyAccessNodeLabelStore]] "
               + "[-transitionToActive [--forceactive] <serviceId>] "
               + "[-transitionToStandby <serviceId>] "
               + "[-getServiceState <serviceId>] [-checkHealth <serviceId>] [-help [cmd]]";