You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Stefano Baghino (JIRA)" <ji...@apache.org> on 2016/01/20 10:23:39 UTC
[jira] [Commented] (FLINK-2021) Rework examples to use new
ParameterTool
[ https://issues.apache.org/jira/browse/FLINK-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15108268#comment-15108268 ]
Stefano Baghino commented on FLINK-2021:
----------------------------------------
I've noticed that the debate took place in the ML with a positive response but that no work has been done on this issue so far. Would it be ok if I take care of this issue?
> Rework examples to use new 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)