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 6CD6D18903 for ; Tue, 23 Feb 2016 15:40:18 +0000 (UTC) Received: (qmail 62702 invoked by uid 500); 23 Feb 2016 15:40:18 -0000 Delivered-To: apmail-flink-issues-archive@flink.apache.org Received: (qmail 62635 invoked by uid 500); 23 Feb 2016 15:40:18 -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 62620 invoked by uid 99); 23 Feb 2016 15:40:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Feb 2016 15:40:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1AC9A2C14E1 for ; Tue, 23 Feb 2016 15:40:18 +0000 (UTC) Date: Tue, 23 Feb 2016 15:40:18 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-2021) Rework examples to use 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=15159056#comment-15159056 ] ASF GitHub Bot commented on FLINK-2021: --------------------------------------- Github user rmetzger commented on the pull request: https://github.com/apache/flink/pull/1581#issuecomment-187752847 +1 to merge the changes. I rebased the code already locally. Right now, I'm running a final travis test. If it passes, I'll merge the change. > 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 > Assignee: Stefano Baghino > 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)