[
https://issues.apache.org/jira/browse/HDFS-13507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17616818#comment-17616818
]
ASF GitHub Bot commented on HDFS-13507:
---------------------------------------
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;
}
```
> RBF: Remove update functionality from routeradmin's add cmd
> -----------------------------------------------------------
>
> Key: HDFS-13507
> URL: https://issues.apache.org/jira/browse/HDFS-13507
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: Wei Yan
> Assignee: Gang Li
> Priority: Minor
> Labels: incompatible, pull-request-available
> Attachments: HDFS-13507-HDFS-13891.003.patch,
> HDFS-13507-HDFS-13891.004.patch, HDFS-13507.000.patch, HDFS-13507.001.patch,
> HDFS-13507.002.patch, HDFS-13507.003.patch
>
>
> Follow up the discussion in HDFS-13326. We should remove the "update"
> functionality from routeradmin's add cmd, to make it consistent with RPC
> calls.
> Note that: this is an incompatible change.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]