From c9e5a2b9b4e2853b75d63581d93f306e4b1caf77 Mon Sep 17 00:00:00 2001 From: slfan1989 Date: Sat, 4 Nov 2023 08:05:09 +0800 Subject: [PATCH] YARN-11483. [Federation] Router AdminCLI Supports Clean Finish Apps. --- .../hadoop/yarn/client/cli/RouterCLI.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RouterCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RouterCLI.java index 2da584f9d61bb..e52dbaafd9163 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RouterCLI.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RouterCLI.java @@ -227,12 +227,34 @@ public class RouterCLI extends Configured implements Tool { .addExample(POLICY_LIST_USAGE.args, POLICY_LIST_USAGE_EXAMPLE_1) .addExample(POLICY_LIST_USAGE.args, POLICY_LIST_USAGE_EXAMPLE_2); + // Command3: application + private static final String CMD_APPLICATION = "-application"; + + // Application Delete + protected final static UsageInfo APPLICATION_DELETE_USAGE = new UsageInfo( + "--delete ", + "This command is used to delete the specified application."); + + protected final static String APPLICATION_DELETE_USAGE_EXAMPLE_DESC = + "If we want to delete application_1440536969523_0001."; + + protected final static String APPLICATION_DELETE_USAGE_EXAMPLE_1 = + "yarn routeradmin -application --delete application_1440536969523_0001"; + + protected final static RouterCmdUsageInfos APPLICATION_USAGEINFOS = new RouterCmdUsageInfos() + // application delete + .addUsageInfo(APPLICATION_DELETE_USAGE) + .addExampleDescs(APPLICATION_DELETE_USAGE.args, APPLICATION_DELETE_USAGE_EXAMPLE_DESC) + .addExample(APPLICATION_DELETE_USAGE.args, APPLICATION_DELETE_USAGE_EXAMPLE_1); + protected final static Map ADMIN_USAGE = ImmutableMap.builder() // Command1: deregisterSubCluster .put(CMD_DEREGISTERSUBCLUSTER, DEREGISTER_SUBCLUSTER_USAGEINFOS) // Command2: policy .put(CMD_POLICY, POLICY_USAGEINFOS) + // Command3: application + .put(CMD_APPLICATION, APPLICATION_USAGEINFOS) .build(); public RouterCLI() {