flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Metzger (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLINK-2021) Rework examples to use new ParameterTool
Date Fri, 15 May 2015 12:17:59 GMT
Robert Metzger created FLINK-2021:

             Summary: 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

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):

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();

This message was sent by Atlassian JIRA

View raw message