ZanderXu commented on code in PR #4990:
URL: https://github.com/apache/hadoop/pull/4990#discussion_r994230000
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java:
##########
@@ -147,13 +147,13 @@ private String getUsage(String cmd) {
return usage.toString();
}
if (cmd.equals("-add")) {
- return "\t[-add <source> <nameservice1, nameservice2, ...> <destination>
"
+ return "\t[-add <source> <nameservice1, nameservice2, ...>
<destination1, destination2, ...> "
+ "[-readonly] [-faulttolerant] "
+ "[-order HASH|LOCAL|RANDOM|HASH_ALL|SPACE] "
+ "-owner <owner> -group <group> -mode <mode>]";
} else if (cmd.equals("-update")) {
return "\t[-update <source>"
- + " [<nameservice1, nameservice2, ...> <destination>] "
+ + " [<nameservice1, nameservice2, ...> <destination1, destination2,
...>] "
Review Comment:
Sir, `<source> <nameservice1, nameservice2> <destination>` still works well
right now.
If user inputed multiple destinations, the number of destinations should be
equals with the number of namespace.
```
private Map<String, String> getDestMap(String[] nss, String[] destinations)
throws IOException {
// It's ok if there is only one namespace and one destination.
// It's ok if there are multiple namespaces and one destination.
// It's ok if there are multiple namespaces and the same number of
destinations.
if (nss.length != destinations.length) {
if (nss.length == 1 || destinations.length > 1) {
String message = "Invalid namespaces and destinations."
+ " The number of destinations " + destinations.length
+ " is not matched with the number of namespaces " + nss.length;
System.err.println(message);
throw new IOException(message);
}
}
Map<String, String> destMap = new LinkedHashMap<>();
for (int index = 0; index < nss.length; index++) {
int destIndex = destinations.length == 1 ? 0 : index;
destMap.put(nss[index], destinations[destIndex]);
}
return destMap;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]