From b06c2345efffde2955b8c2d5fd954ad73b5d8677 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Wed, 14 Aug 2019 20:22:24 +0530 Subject: [PATCH] HDFS-14713. RBF: RouterAdmin supports refreshRouterArgs command but not on display. Contributed by wangzhaohui. --- .../hadoop/hdfs/tools/federation/RouterAdmin.java | 2 +- .../server/federation/router/TestRouterAdminCLI.java | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java index 4b505344751..b39ed96037f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java @@ -127,7 +127,7 @@ public class RouterAdmin extends Configured implements Tool { {"-add", "-update", "-rm", "-ls", "-getDestination", "-setQuota", "-clrQuota", "-safemode", "-nameservice", "-getDisabledNameservices", - "-refresh"}; + "-refresh", "-refreshRouterArgs"}; StringBuilder usage = new StringBuilder(); usage.append("Usage: hdfs dfsrouteradmin :\n"); for (int i = 0; i < commands.length; i++) { diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java index 5a20a7094e3..731d5d45608 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java @@ -576,6 +576,12 @@ public class TestRouterAdminCLI { assertTrue(out.toString().contains("\t[-getDestination ]")); out.reset(); + argv = new String[] {"-refreshRouterArgs"}; + assertEquals(-1, ToolRunner.run(admin, argv)); + assertTrue(out.toString().contains("\t[-refreshRouterArgs " + + " [arg1..argn]]")); + out.reset(); + argv = new String[] {"-Random"}; assertEquals(-1, ToolRunner.run(admin, argv)); String expected = "Usage: hdfs dfsrouteradmin :\n" @@ -594,7 +600,9 @@ public class TestRouterAdminCLI { + "]\n" + "\t[-clrQuota ]\n" + "\t[-safemode enter | leave | get]\n" + "\t[-nameservice enable | disable ]\n" - + "\t[-getDisabledNameservices]"; + + "\t[-getDisabledNameservices]\n" + + "\t[-refresh]\n" + + "\t[-refreshRouterArgs [arg1..argn]]"; assertTrue("Wrong message: " + out, out.toString().contains(expected)); out.reset(); }