diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java index 8555ad7d2c6..dfa03e896e1 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java @@ -19,6 +19,7 @@ package org.apache.hadoop.ha; import java.io.IOException; import java.io.PrintStream; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Map; @@ -68,7 +69,7 @@ public abstract class HAAdmin extends Configured implements Tool { protected final static Map USAGE = ImmutableMap.builder() .put("-transitionToActive", - new UsageInfo(" [--"+FORCEACTIVE+"]", "Transitions the service into Active state")) + new UsageInfo(" [--"+FORCEACTIVE+"]", "Transitions the service into Active state")) .put("-transitionToStandby", new UsageInfo("", "Transitions the service into Standby state")) .put("-failover", @@ -104,7 +105,8 @@ public abstract class HAAdmin extends Configured implements Tool { protected abstract HAServiceTarget resolveTarget(String string); protected Collection getTargetIds(String targetNodeToActivate) { - return Arrays.asList(new String[]{targetNodeToActivate}); + return new ArrayList( + Arrays.asList(new String[]{targetNodeToActivate})); } protected String getUsageString() { diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 193b48612a5..1a19f528036 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -236,6 +236,9 @@ Release 2.5.0 - UNRELEASED YARN-2148. TestNMClient failed due more exit code values added and passed to AM (Wangda Tan via bikas) + YARN-2075. Fixed the test failure of TestRMAdminCLI. (Kenji Kikushima via + zjshen) + Release 2.4.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java index f4ef0aa6ad2..419b9ae4869 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java @@ -305,7 +305,8 @@ public class TestRMAdminCLI { testError(new String[] { "-help", "-getGroups" }, "Usage: yarn rmadmin [-getGroups [username]]", dataErr, 0); testError(new String[] { "-help", "-transitionToActive" }, - "Usage: yarn rmadmin [-transitionToActive ]", dataErr, 0); + "Usage: yarn rmadmin [-transitionToActive " + + " [--forceactive]]", dataErr, 0); testError(new String[] { "-help", "-transitionToStandby" }, "Usage: yarn rmadmin [-transitionToStandby ]", dataErr, 0); testError(new String[] { "-help", "-getServiceState" }, @@ -332,9 +333,9 @@ public class TestRMAdminCLI { "yarn rmadmin [-refreshQueues] [-refreshNodes] [-refreshSuper" + "UserGroupsConfiguration] [-refreshUserToGroupsMappings] " + "[-refreshAdminAcls] [-refreshServiceAcl] [-getGroup" + - " [username]] [-help [cmd]] [-transitionToActive ]" + - " [-transitionToStandby ] [-failover [--forcefence]" + - " [--forceactive] ] " + + " [username]] [-help [cmd]] [-transitionToActive " + + " [--forceactive]] [-transitionToStandby ] [-failover" + + " [--forcefence] [--forceactive] ] " + "[-getServiceState ] [-checkHealth ]")); } finally { System.setOut(oldOutPrintStream);