Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-2021

Rework examples to use ParameterTool

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.9
    • 1.0.0
    • Examples

    Description

      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();
          env.getConfig().setUserConfig(pt);
      

      Attachments

        Issue Links

          Activity

            People

              stefanobaghino Stefano Baghino
              rmetzger Robert Metzger
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: