HDFS-14713. RBF: RouterAdmin supports refreshRouterArgs command but not on display. Contributed by wangzhaohui.

This commit is contained in:
Ayush Saxena 2019-08-14 20:22:24 +05:30
parent 3e0410449f
commit b06c2345ef
2 changed files with 10 additions and 2 deletions

View File

@ -127,7 +127,7 @@ private String getUsage(String cmd) {
{"-add", "-update", "-rm", "-ls", "-getDestination", {"-add", "-update", "-rm", "-ls", "-getDestination",
"-setQuota", "-clrQuota", "-setQuota", "-clrQuota",
"-safemode", "-nameservice", "-getDisabledNameservices", "-safemode", "-nameservice", "-getDisabledNameservices",
"-refresh"}; "-refresh", "-refreshRouterArgs"};
StringBuilder usage = new StringBuilder(); StringBuilder usage = new StringBuilder();
usage.append("Usage: hdfs dfsrouteradmin :\n"); usage.append("Usage: hdfs dfsrouteradmin :\n");
for (int i = 0; i < commands.length; i++) { for (int i = 0; i < commands.length; i++) {

View File

@ -576,6 +576,12 @@ public void testInvalidArgumentMessage() throws Exception {
assertTrue(out.toString().contains("\t[-getDestination <path>]")); assertTrue(out.toString().contains("\t[-getDestination <path>]"));
out.reset(); out.reset();
argv = new String[] {"-refreshRouterArgs"};
assertEquals(-1, ToolRunner.run(admin, argv));
assertTrue(out.toString().contains("\t[-refreshRouterArgs " +
"<host:ipc_port> <key> [arg1..argn]]"));
out.reset();
argv = new String[] {"-Random"}; argv = new String[] {"-Random"};
assertEquals(-1, ToolRunner.run(admin, argv)); assertEquals(-1, ToolRunner.run(admin, argv));
String expected = "Usage: hdfs dfsrouteradmin :\n" String expected = "Usage: hdfs dfsrouteradmin :\n"
@ -594,7 +600,9 @@ public void testInvalidArgumentMessage() throws Exception {
+ "<quota in bytes or quota size string>]\n" + "\t[-clrQuota <path>]\n" + "<quota in bytes or quota size string>]\n" + "\t[-clrQuota <path>]\n"
+ "\t[-safemode enter | leave | get]\n" + "\t[-safemode enter | leave | get]\n"
+ "\t[-nameservice enable | disable <nameservice>]\n" + "\t[-nameservice enable | disable <nameservice>]\n"
+ "\t[-getDisabledNameservices]"; + "\t[-getDisabledNameservices]\n"
+ "\t[-refresh]\n"
+ "\t[-refreshRouterArgs <host:ipc_port> <key> [arg1..argn]]";
assertTrue("Wrong message: " + out, out.toString().contains(expected)); assertTrue("Wrong message: " + out, out.toString().contains(expected));
out.reset(); out.reset();
} }