[
https://issues.apache.org/jira/browse/FLINK-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15133923#comment-15133923
]
ASF GitHub Bot commented on FLINK-2021:
---------------------------------------
Github user fhueske commented on the pull request:
https://github.com/apache/flink/pull/1581#issuecomment-180279675
Hi Stefano, thanks for the update!
- you are right, it is good practice to not squash commits the address PR
feedback. That make following the changes much easier. These commits will be
squashed before merging to the master branch.
- I am not sure if we are talking about the same thing. Robert suggested to
move the code for reading inputs into the main method for examples that have
only a single input such as TwitterStream or WordCount. This is the point we
discussed before. Usually, there is only one parameter to check, i.e., whether
an input path was provided or not. We do not need to move that into a
`checkParameters` method, IMO.
> 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)