[
https://issues.apache.org/jira/browse/FLINK-2018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14558367#comment-14558367
]
ASF GitHub Bot commented on FLINK-2018:
---------------------------------------
Github user rmetzger commented on a diff in the pull request:
https://github.com/apache/flink/pull/720#discussion_r30986863
--- Diff:
flink-java/src/test/java/org/apache/flink/api/java/utils/ParameterToolTest.java
---
@@ -150,6 +150,12 @@ public void testMerged() {
validate(parameter);
}
+ @Test
+ public void testFromGenericOptionsParser() throws IOException {
+ ParameterTool parameter =
ParameterTool.fromGenericOptionsParser(new String[]{"-D", "input=myInput",
"-DexpectedCount=15"});
+ validate(parameter);
+ }
--- End diff --
Sorry that I didn't write this earlier when I did the first review of the
pull request:
Can you also add a test where we read one of the arguments (say
input=myinput) from a xml configuration file.
As far as I can see, the GenericOptionsParser also supports specifying
`-conf path/to/file.xml`.
That would be amazing ,)
> Add ParameterUtil.fromGenericOptionsParser() for compatibility to Hadoop's
> argument parser
> ------------------------------------------------------------------------------------------
>
> Key: FLINK-2018
> URL: https://issues.apache.org/jira/browse/FLINK-2018
> Project: Flink
> Issue Type: Improvement
> Reporter: Robert Metzger
> Priority: Minor
> Labels: starter
>
> In FLINK-1525 we've added the {{ParameterTool}}.
> For users used to Hadoop's {{GenericOptionsParser}} it would be great to
> provide a compatible parser.
> See:
> https://hadoop.apache.org/docs/r1.0.4/api/org/apache/hadoop/util/GenericOptionsParser.html
> {code}
> @Test
> public void testFromGenericOptionsParser() {
> ParameterUtil parameter = ParameterUtil.fromGenericOptionsParser(new
> String[]{"-D", "input=myinput", "-DexpectedCount=15"});
> validate(parameter);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)