HDFS-14457. RBF: Add order text SPACE in CLI command 'hdfs dfsrouteradmin'. Contributed by luhuachao.
This commit is contained in:
parent
021a43b1a4
commit
b522b52bb1
|
@ -140,13 +140,14 @@ public class RouterAdmin extends Configured implements Tool {
|
||||||
}
|
}
|
||||||
if (cmd.equals("-add")) {
|
if (cmd.equals("-add")) {
|
||||||
return "\t[-add <source> <nameservice1, nameservice2, ...> <destination> "
|
return "\t[-add <source> <nameservice1, nameservice2, ...> <destination> "
|
||||||
+ "[-readonly] [-faulttolerant] [-order HASH|LOCAL|RANDOM|HASH_ALL] "
|
+ "[-readonly] [-faulttolerant] "
|
||||||
|
+ "[-order HASH|LOCAL|RANDOM|HASH_ALL|SPACE] "
|
||||||
+ "-owner <owner> -group <group> -mode <mode>]";
|
+ "-owner <owner> -group <group> -mode <mode>]";
|
||||||
} else if (cmd.equals("-update")) {
|
} else if (cmd.equals("-update")) {
|
||||||
return "\t[-update <source>"
|
return "\t[-update <source>"
|
||||||
+ " [<nameservice1, nameservice2, ...> <destination>] "
|
+ " [<nameservice1, nameservice2, ...> <destination>] "
|
||||||
+ "[-readonly true|false] [-faulttolerant true|false]"
|
+ "[-readonly true|false] [-faulttolerant true|false] "
|
||||||
+ " [-order HASH|LOCAL|RANDOM|HASH_ALL] "
|
+ "[-order HASH|LOCAL|RANDOM|HASH_ALL|SPACE] "
|
||||||
+ "-owner <owner> -group <group> -mode <mode>]";
|
+ "-owner <owner> -group <group> -mode <mode>]";
|
||||||
} else if (cmd.equals("-rm")) {
|
} else if (cmd.equals("-rm")) {
|
||||||
return "\t[-rm <source>]";
|
return "\t[-rm <source>]";
|
||||||
|
|
|
@ -243,6 +243,7 @@ public class TestRouterAdminCLI {
|
||||||
testAddOrderMountTable(DestinationOrder.LOCAL);
|
testAddOrderMountTable(DestinationOrder.LOCAL);
|
||||||
testAddOrderMountTable(DestinationOrder.RANDOM);
|
testAddOrderMountTable(DestinationOrder.RANDOM);
|
||||||
testAddOrderMountTable(DestinationOrder.HASH_ALL);
|
testAddOrderMountTable(DestinationOrder.HASH_ALL);
|
||||||
|
testAddOrderMountTable(DestinationOrder.SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -529,7 +530,7 @@ public class TestRouterAdminCLI {
|
||||||
assertTrue("Wrong message: " + out, out.toString().contains(
|
assertTrue("Wrong message: " + out, out.toString().contains(
|
||||||
"\t[-add <source> <nameservice1, nameservice2, ...> <destination> "
|
"\t[-add <source> <nameservice1, nameservice2, ...> <destination> "
|
||||||
+ "[-readonly] [-faulttolerant] "
|
+ "[-readonly] [-faulttolerant] "
|
||||||
+ "[-order HASH|LOCAL|RANDOM|HASH_ALL] "
|
+ "[-order HASH|LOCAL|RANDOM|HASH_ALL|SPACE] "
|
||||||
+ "-owner <owner> -group <group> -mode <mode>]"));
|
+ "-owner <owner> -group <group> -mode <mode>]"));
|
||||||
out.reset();
|
out.reset();
|
||||||
|
|
||||||
|
@ -538,7 +539,7 @@ public class TestRouterAdminCLI {
|
||||||
assertTrue("Wrong message: " + out, out.toString().contains(
|
assertTrue("Wrong message: " + out, out.toString().contains(
|
||||||
"\t[-update <source> [<nameservice1, nameservice2, ...> <destination>] "
|
"\t[-update <source> [<nameservice1, nameservice2, ...> <destination>] "
|
||||||
+ "[-readonly true|false] [-faulttolerant true|false] "
|
+ "[-readonly true|false] [-faulttolerant true|false] "
|
||||||
+ "[-order HASH|LOCAL|RANDOM|HASH_ALL] "
|
+ "[-order HASH|LOCAL|RANDOM|HASH_ALL|SPACE] "
|
||||||
+ "-owner <owner> -group <group> -mode <mode>]"));
|
+ "-owner <owner> -group <group> -mode <mode>]"));
|
||||||
out.reset();
|
out.reset();
|
||||||
|
|
||||||
|
@ -579,11 +580,13 @@ public class TestRouterAdminCLI {
|
||||||
assertEquals(-1, ToolRunner.run(admin, argv));
|
assertEquals(-1, ToolRunner.run(admin, argv));
|
||||||
String expected = "Usage: hdfs dfsrouteradmin :\n"
|
String expected = "Usage: hdfs dfsrouteradmin :\n"
|
||||||
+ "\t[-add <source> <nameservice1, nameservice2, ...> <destination> "
|
+ "\t[-add <source> <nameservice1, nameservice2, ...> <destination> "
|
||||||
+ "[-readonly] [-faulttolerant] [-order HASH|LOCAL|RANDOM|HASH_ALL] "
|
+ "[-readonly] [-faulttolerant] "
|
||||||
|
+ "[-order HASH|LOCAL|RANDOM|HASH_ALL|SPACE] "
|
||||||
+ "-owner <owner> -group <group> -mode <mode>]\n"
|
+ "-owner <owner> -group <group> -mode <mode>]\n"
|
||||||
+ "\t[-update <source> [<nameservice1, nameservice2, ...> "
|
+ "\t[-update <source> [<nameservice1, nameservice2, ...> "
|
||||||
+ "<destination>] [-readonly true|false]"
|
+ "<destination>] [-readonly true|false]"
|
||||||
+ " [-faulttolerant true|false] [-order HASH|LOCAL|RANDOM|HASH_ALL] "
|
+ " [-faulttolerant true|false] "
|
||||||
|
+ "[-order HASH|LOCAL|RANDOM|HASH_ALL|SPACE] "
|
||||||
+ "-owner <owner> -group <group> -mode <mode>]\n" + "\t[-rm <source>]\n"
|
+ "-owner <owner> -group <group> -mode <mode>]\n" + "\t[-rm <source>]\n"
|
||||||
+ "\t[-ls <path>]\n"
|
+ "\t[-ls <path>]\n"
|
||||||
+ "\t[-getDestination <path>]\n"
|
+ "\t[-getDestination <path>]\n"
|
||||||
|
@ -1139,6 +1142,7 @@ public class TestRouterAdminCLI {
|
||||||
testUpdateOrderMountTable(DestinationOrder.LOCAL);
|
testUpdateOrderMountTable(DestinationOrder.LOCAL);
|
||||||
testUpdateOrderMountTable(DestinationOrder.RANDOM);
|
testUpdateOrderMountTable(DestinationOrder.RANDOM);
|
||||||
testUpdateOrderMountTable(DestinationOrder.HASH_ALL);
|
testUpdateOrderMountTable(DestinationOrder.HASH_ALL);
|
||||||
|
testUpdateOrderMountTable(DestinationOrder.SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue