Return-Path: X-Original-To: apmail-flink-issues-archive@minotaur.apache.org Delivered-To: apmail-flink-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3662610E41 for ; Wed, 2 Sep 2015 12:09:46 +0000 (UTC) Received: (qmail 26101 invoked by uid 500); 2 Sep 2015 12:09:46 -0000 Delivered-To: apmail-flink-issues-archive@flink.apache.org Received: (qmail 26036 invoked by uid 500); 2 Sep 2015 12:09:46 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 26006 invoked by uid 99); 2 Sep 2015 12:09:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Sep 2015 12:09:46 +0000 Date: Wed, 2 Sep 2015 12:09:45 +0000 (UTC) From: "Robert Metzger (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-2021) Rework examples to use new ParameterTool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14727226#comment-14727226 ] Robert Metzger commented on FLINK-2021: --------------------------------------- No, I think nobody is working on this. Before changing all examples, I would actually like to seek for consensus on the mailing list. The change affects how new users learn to use Flink. Do you want to write to dev@flink or should I do it? > 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)