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

ASF GitHub Bot commented on FLINK-2021:
---------------------------------------

Github user rmetzger commented on the pull request:

    https://github.com/apache/flink/pull/1536#issuecomment-174953115
  
    I don't really see the points of encapsulating parts of the examples into 
methods: Usually, methods are used when functionality is used in different 
places. In this case, every method is only called once (there is no generic 
abstraction). Its adding an unnecessary level of indirection, making it harder 
to read the code.
    I don't see why reading the initial dataset is less important than the rest 
of the application. 
    
    Reading the file is just 5 lines of code (relevant code, I woudn't call 
that boilerplate).


> 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