[ 
https://issues.apache.org/jira/browse/FLINK-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15108398#comment-15108398
 ] 

Robert Metzger commented on FLINK-2021:
---------------------------------------

Hi Stefano,

cool. I think nobody is currently working on this issue.
Some thoughts on this: 
I think that using the ParameterTool will improve the readability of the 
examples. In the beginning I was a bit hesitant with pushing the ParameterTool 
into all examples because I wasn't sure if users would like it. But I've seen 
many happy users and a wide adoption of it.

We recently added RequiredParameters into Flink as well. They'll also allow you 
to print a help text. Maybe it makes sense to use the RequiredParameters in the 
examples.

How about you introduce the tool into one or two examples, we review the change 
together and then you apply it to all examples?

Also note, that we need to carefully check and rework the examples in the 
documentation to be in sync after the change.

> Rework examples to use ParameterTool
> ------------------------------------
>
>                 Key: FLINK-2021
>                 URL: https://issues.apache.org/jira/browse/FLINK-2021
>             Project: Flink
>          Issue Type: Improvement
>          Components: Examples
>    Affects Versions: 0.9
>            Reporter: Robert Metzger
>            Priority: Minor
>              Labels: starter
>
> In FLINK-1525, we introduced the {{ParameterTool}}.
> We should port the examples to use the tool.
> The examples could look like this (we should maybe discuss it first on the 
> mailing lists):
> {code}
> public static void main(String[] args) throws Exception {
>     ParameterTool pt = ParameterTool.fromArgs(args);
>     boolean fileOutput = pt.getNumberOfParameters() == 2;
>     String textPath = null;
>     String outputPath = null;
>     if(fileOutput) {
>         textPath = pt.getRequired("input");
>         outputPath = pt.getRequired("output");
>     }
>     // set up the execution environment
>     final ExecutionEnvironment env = 
> ExecutionEnvironment.getExecutionEnvironment();
>     env.getConfig().setUserConfig(pt);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to