[
https://issues.apache.org/jira/browse/HDFS-16856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17646225#comment-17646225
]
ASF GitHub Bot commented on HDFS-16856:
---------------------------------------
omalley commented on code in PR #5195:
URL: https://github.com/apache/hadoop/pull/5195#discussion_r1046122861
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java:
##########
@@ -1182,6 +1200,19 @@ public static String popFirstNonOption(List<String>
args) {
}
return null;
}
+ /**
+ * From a list of command-line arguments, ensure that all of the arguments
+ * have been used except a possible "--".
+ *
+ * @param args List of arguments.
+ * @throws IllegalArgumentException if some arguments were not used
+ */
+ public static void ensureAllUsed(List<String> args) throws
IllegalArgumentException {
+ if (!args.isEmpty() && !(args.size() == 1 && "--".equals(args.get(0)))) {
Review Comment:
I find writing code that depends overly on knowing the precedence for
non-math operators leads to trouble, so I'd prefer to leave them in.
> RBF: Refactor router admin command to use HDFS AdminHelper class
> ----------------------------------------------------------------
>
> Key: HDFS-16856
> URL: https://issues.apache.org/jira/browse/HDFS-16856
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: rbf
> Reporter: Owen O'Malley
> Assignee: Owen O'Malley
> Priority: Major
> Labels: pull-request-available
>
> Currently, the router admin class is a bit of a mess with a lot of custom
> programming. We should use the infrastructure that was developed in the
> AdminHelper class to standardize the command processing.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]