YARN-2075. Fixed the test failure of TestRMAdminCLI. Contributed by Kenji Kikushima.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1602071 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhijie Shen 2014-06-12 06:40:32 +00:00
parent 2f4f261cda
commit deb858a835
3 changed files with 12 additions and 6 deletions

View File

@ -19,6 +19,7 @@
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<String, UsageInfo> USAGE =
ImmutableMap.<String, UsageInfo>builder()
.put("-transitionToActive",
new UsageInfo(" <serviceId> [--"+FORCEACTIVE+"]", "Transitions the service into Active state"))
new UsageInfo("<serviceId> [--"+FORCEACTIVE+"]", "Transitions the service into Active state"))
.put("-transitionToStandby",
new UsageInfo("<serviceId>", "Transitions the service into Standby state"))
.put("-failover",
@ -104,7 +105,8 @@ protected HAAdmin(Configuration conf) {
protected abstract HAServiceTarget resolveTarget(String string);
protected Collection<String> getTargetIds(String targetNodeToActivate) {
return Arrays.asList(new String[]{targetNodeToActivate});
return new ArrayList<String>(
Arrays.asList(new String[]{targetNodeToActivate}));
}
protected String getUsageString() {

View File

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

View File

@ -305,7 +305,8 @@ public void testHelp() throws Exception {
testError(new String[] { "-help", "-getGroups" },
"Usage: yarn rmadmin [-getGroups [username]]", dataErr, 0);
testError(new String[] { "-help", "-transitionToActive" },
"Usage: yarn rmadmin [-transitionToActive <serviceId>]", dataErr, 0);
"Usage: yarn rmadmin [-transitionToActive <serviceId>" +
" [--forceactive]]", dataErr, 0);
testError(new String[] { "-help", "-transitionToStandby" },
"Usage: yarn rmadmin [-transitionToStandby <serviceId>]", dataErr, 0);
testError(new String[] { "-help", "-getServiceState" },
@ -332,9 +333,9 @@ public void testHelp() throws Exception {
"yarn rmadmin [-refreshQueues] [-refreshNodes] [-refreshSuper" +
"UserGroupsConfiguration] [-refreshUserToGroupsMappings] " +
"[-refreshAdminAcls] [-refreshServiceAcl] [-getGroup" +
" [username]] [-help [cmd]] [-transitionToActive <serviceId>]" +
" [-transitionToStandby <serviceId>] [-failover [--forcefence]" +
" [--forceactive] <serviceId> <serviceId>] " +
" [username]] [-help [cmd]] [-transitionToActive <serviceId>" +
" [--forceactive]] [-transitionToStandby <serviceId>] [-failover" +
" [--forcefence] [--forceactive] <serviceId> <serviceId>] " +
"[-getServiceState <serviceId>] [-checkHealth <serviceId>]"));
} finally {
System.setOut(oldOutPrintStream);