Author: jianhe Date: Thu Dec 26 22:05:16 2013 New Revision: 1553596 URL: http://svn.apache.org/r1553596 Log: YARN-1527. Fixed yarn rmadmin command to print the correct usage info. Contributed by Akira AJISAKA.
Modified: hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java Modified: hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt?rev=1553596&r1=1553595&r2=1553596&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt (original) +++ hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt Thu Dec 26 22:05:16 2013 @@ -269,6 +269,9 @@ Release 2.4.0 - UNRELEASED YARN-1451. TestResourceManager relies on the scheduler assigning multiple containers in a single node update. (Sandy Ryza via kasha) + YARN-1527. Fix yarn rmadmin command to print the correct usage info. + (Akira AJISAKA via jianhe) + Release 2.3.0 - UNRELEASED INCOMPATIBLE CHANGES Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java?rev=1553596&r1=1553595&r2=1553596&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java (original) +++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java Thu Dec 26 22:05:16 2013 @@ -122,13 +122,13 @@ public class RMAdminCLI extends HAAdmin } } String space = (usageInfo.args == "") ? "" : " "; - builder.append("Usage: java RMAdmin [" + builder.append("Usage: yarn rmadmin [" + cmd + space + usageInfo.args + "]\n"); } private static void buildUsageMsg(StringBuilder builder) { - builder.append("Usage: java RMAdmin"); + builder.append("Usage: yarn rmadmin\n"); for (String cmdKey : ADMIN_USAGE.keySet()) { UsageInfo usageInfo = ADMIN_USAGE.get(cmdKey); builder.append(" " + cmdKey + " " + usageInfo.args + "\n"); Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java?rev=1553596&r1=1553595&r2=1553596&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java (original) +++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java Thu Dec 26 22:05:16 2013 @@ -241,37 +241,37 @@ public class TestRMAdminCLI { "commands if none")); testError(new String[] { "-help", "-refreshQueues" }, - "Usage: java RMAdmin [-refreshQueues]", dataErr, 0); + "Usage: yarn rmadmin [-refreshQueues]", dataErr, 0); testError(new String[] { "-help", "-refreshNodes" }, - "Usage: java RMAdmin [-refreshNodes]", dataErr, 0); + "Usage: yarn rmadmin [-refreshNodes]", dataErr, 0); testError(new String[] { "-help", "-refreshUserToGroupsMappings" }, - "Usage: java RMAdmin [-refreshUserToGroupsMappings]", dataErr, 0); + "Usage: yarn rmadmin [-refreshUserToGroupsMappings]", dataErr, 0); testError( new String[] { "-help", "-refreshSuperUserGroupsConfiguration" }, - "Usage: java RMAdmin [-refreshSuperUserGroupsConfiguration]", + "Usage: yarn rmadmin [-refreshSuperUserGroupsConfiguration]", dataErr, 0); testError(new String[] { "-help", "-refreshAdminAcls" }, - "Usage: java RMAdmin [-refreshAdminAcls]", dataErr, 0); + "Usage: yarn rmadmin [-refreshAdminAcls]", dataErr, 0); testError(new String[] { "-help", "-refreshServiceAcl" }, - "Usage: java RMAdmin [-refreshServiceAcl]", dataErr, 0); + "Usage: yarn rmadmin [-refreshServiceAcl]", dataErr, 0); testError(new String[] { "-help", "-getGroups" }, - "Usage: java RMAdmin [-getGroups [username]]", dataErr, 0); + "Usage: yarn rmadmin [-getGroups [username]]", dataErr, 0); testError(new String[] { "-help", "-transitionToActive" }, - "Usage: java RMAdmin [-transitionToActive <serviceId>]", dataErr, 0); + "Usage: yarn rmadmin [-transitionToActive <serviceId>]", dataErr, 0); testError(new String[] { "-help", "-transitionToStandby" }, - "Usage: java RMAdmin [-transitionToStandby <serviceId>]", dataErr, 0); + "Usage: yarn rmadmin [-transitionToStandby <serviceId>]", dataErr, 0); testError(new String[] { "-help", "-getServiceState" }, - "Usage: java RMAdmin [-getServiceState <serviceId>]", dataErr, 0); + "Usage: yarn rmadmin [-getServiceState <serviceId>]", dataErr, 0); testError(new String[] { "-help", "-checkHealth" }, - "Usage: java RMAdmin [-checkHealth <serviceId>]", dataErr, 0); + "Usage: yarn rmadmin [-checkHealth <serviceId>]", dataErr, 0); testError(new String[] { "-help", "-failover" }, - "Usage: java RMAdmin " + + "Usage: yarn rmadmin " + "[-failover [--forcefence] [--forceactive] " + "<serviceId> <serviceId>]", dataErr, 0); testError(new String[] { "-help", "-badParameter" }, - "Usage: java RMAdmin", dataErr, 0); + "Usage: yarn rmadmin", dataErr, 0); testError(new String[] { "-badParameter" }, "badParameter: Unknown command", dataErr, -1); } finally {