diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 7a78b965c10..133083c1508 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -31,6 +31,8 @@ Release 2.8.0 - UNRELEASED YARN-2868. FairScheduler: Metric for latency to allocate first container for an application. (Ray Chiang via kasha) + YARN-3397. yarn rmadmin should skip -failover. (J.Andreina via kasha) + OPTIMIZATIONS YARN-3339. TestDockerContainerExecutor should pull a single image and not diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java index 4642add12e3..420eeb0ff12 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java @@ -134,7 +134,8 @@ public class RMAdminCLI extends HAAdmin { private static void appendHAUsage(final StringBuilder usageBuilder) { for (Map.Entry cmdEntry : USAGE.entrySet()) { - if (cmdEntry.getKey().equals("-help")) { + if (cmdEntry.getKey().equals("-help") + || cmdEntry.getKey().equals("-failover")) { continue; } UsageInfo usageInfo = cmdEntry.getValue(); @@ -225,7 +226,7 @@ public class RMAdminCLI extends HAAdmin { } if (isHAEnabled) { for (String cmdKey : USAGE.keySet()) { - if (!cmdKey.equals("-help")) { + if (!cmdKey.equals("-help") && !cmdKey.equals("-failover")) { buildHelpMsg(cmdKey, helpBuilder); helpBuilder.append("\n"); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestRMAdminCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestRMAdminCLI.java index c22494c9eb6..606711008cb 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestRMAdminCLI.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestRMAdminCLI.java @@ -364,16 +364,15 @@ public class TestRMAdminCLI { assertEquals(0, rmAdminCLIWithHAEnabled.run(args)); oldOutPrintStream.println(dataOut); String expectedHelpMsg = - "yarn rmadmin [-refreshQueues] [-refreshNodes] [-refreshSuper" + - "UserGroupsConfiguration] [-refreshUserToGroupsMappings] " + - "[-refreshAdminAcls] [-refreshServiceAcl] [-getGroup" + - " [username]] [[-addToClusterNodeLabels [label1,label2,label3]]" + - " [-removeFromClusterNodeLabels [label1,label2,label3]] [-replaceLabelsOnNode " + - "[node1[:port]=label1,label2 node2[:port]=label1] [-directlyAccessNodeLabelStore]] " + - "[-transitionToActive [--forceactive] ] " + - "[-transitionToStandby ] [-failover" + - " [--forcefence] [--forceactive] ] " + - "[-getServiceState ] [-checkHealth ] [-help [cmd]]"; + "yarn rmadmin [-refreshQueues] [-refreshNodes] [-refreshSuper" + + "UserGroupsConfiguration] [-refreshUserToGroupsMappings] " + + "[-refreshAdminAcls] [-refreshServiceAcl] [-getGroup" + + " [username]] [[-addToClusterNodeLabels [label1,label2,label3]]" + + " [-removeFromClusterNodeLabels [label1,label2,label3]] [-replaceLabelsOnNode " + + "[node1[:port]=label1,label2 node2[:port]=label1] [-directlyAccessNodeLabelStore]] " + + "[-transitionToActive [--forceactive] ] " + + "[-transitionToStandby ] " + + "[-getServiceState ] [-checkHealth ] [-help [cmd]]"; String actualHelpMsg = dataOut.toString(); assertTrue(String.format("Help messages: %n " + actualHelpMsg + " %n doesn't include expected " + "messages: %n" + expectedHelpMsg), actualHelpMsg.contains(expectedHelpMsg