[
https://issues.apache.org/jira/browse/FLINK-1525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14537975#comment-14537975
]
ASF GitHub Bot commented on FLINK-1525:
---------------------------------------
Github user rmetzger commented on the pull request:
https://github.com/apache/flink/pull/664#issuecomment-100923321
@aljoscha:
Is this the API you were thinking of?
```java
RequiredParameters required = new RequiredParameters();
Option input = required.add("input").alt("i").description("Path to input
file or directory"); // parameter with long and short variant
required.add("output"); // parameter only with long variant
Option parallelism =
required.add("parallelism").alt("p").type(Integer.class); // parameter with type
Option spOption =
required.add("sourceParallelism").alt("sp").defaultValue(12).description("Number
specifying the number of parallel data source instances"); // parameter with
default value, specifying the type.
ParameterUtil parameter = ParameterUtil.fromArgs(new String[]{"-i",
"someinput", "--output", "someout", "-p", "15"});
required.check(parameter);
required.printHelp();
required.checkAndPopulate(parameter);
String inputString = input.get();
int par = parallelism.getInteger();
String output = parameter.get("output");
int sourcePar = parameter.getInteger(spOption.getName());
```
> Provide utils to pass -D parameters to UDFs
> --------------------------------------------
>
> Key: FLINK-1525
> URL: https://issues.apache.org/jira/browse/FLINK-1525
> Project: Flink
> Issue Type: Improvement
> Components: flink-contrib
> Reporter: Robert Metzger
> Labels: starter
>
> Hadoop users are used to setting job configuration through "-D" on the
> command line.
> Right now, Flink users have to manually parse command line arguments and pass
> them to the methods.
> It would be nice to provide a standard args parser with is taking care of
> such stuff.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)