[
https://issues.apache.org/jira/browse/FLINK-2021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15130367#comment-15130367
]
ASF GitHub Bot commented on FLINK-2021:
---------------------------------------
GitHub user stefanobaghino opened a pull request:
https://github.com/apache/flink/pull/1581
[FLINK-2021] Rework examples to use ParameterTool
This should fix [FLINK-2021]. I was unable to run a full build because of
permission issues but it should be ready to merged, after any fixes that may be
highlighted by a review.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/radicalbit/flink 2021
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/1581.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1581
----
commit f68cb95af1c27dd8bf99e1a2374969915dd567f9
Author: Stefano Baghino <[email protected]>
Date: 2016-01-21T11:20:49Z
[FLINK-2021] Rework the K-Means examples to use built-in argument parsing
facilities instead of ad-hoc functions
commit a432cc204741dd0a2d505886b987c4113e781c84
Author: Stefano Baghino <[email protected]>
Date: 2016-01-21T11:33:15Z
[FLINK-2021] Renamed user-facing names for options
commit a6d7f38a0a41f5e7e1290afd267eb6b260f3ae06
Author: Stefano Baghino <[email protected]>
Date: 2016-01-21T12:07:39Z
[FLINK-2021] Updated documentation to be in sync with reworked examples
commit 31a6a1e4d1bae900866fc74aff9402b2cd3cee94
Author: Stefano Baghino <[email protected]>
Date: 2016-01-21T13:40:39Z
[FLINK-2021] Removed return statement in Scala, updated usage message to
reflect the changes
commit 2c4978dce0d4a8a8cd11c2e32319a71b2b57427a
Author: Stefano Baghino <[email protected]>
Date: 2016-01-21T14:01:45Z
[FLINK-2021] Delegating the usage line to the the object
commit 65b64746a006c01b92b02f4549d744776ed00980
Author: Stefano Baghino <[email protected]>
Date: 2016-01-21T14:05:04Z
[FLINK-2021] Removed unused imports (checkstyle compliance)
commit 47c0d26f3fa7b3d9913114e45e8895b70c80e538
Author: Stefano Baghino <[email protected]>
Date: 2016-01-21T14:47:00Z
[FLINK-2021] Removed the parseParameters and printRunWithDefaultParams
methods
commit 63bb710babcd1b0fb8d7a5253e442612ef3a86e6
Author: Stefano Baghino <[email protected]>
Date: 2016-01-21T17:08:47Z
[FLINK-2021] Removing static members, ditching RequiredParameters to
improve readability
commit 857e625d29490112bfd63d0595aa6bcfe4ab8890
Author: Stefano Baghino <[email protected]>
Date: 2016-01-22T09:11:46Z
[FLINK-2021] Reworked the Scala example to keep it up to date with the Java
one
commit fbd5f8ee0a06238d7f1d7b10be2b12f2c1428599
Author: Stefano Baghino <[email protected]>
Date: 2016-01-26T11:44:13Z
[FLINK-2021] Restored input source reading in separate methods
commit dc2480c8fe97c698a31918c825c63e193fe84302
Author: Stefano Baghino <[email protected]>
Date: 2016-01-26T13:46:09Z
[FLINK-2021] Using POJO types instead of tuple converters
commit 32b51c4e4b9ec43e3ea54bc7ae2573e96a961e58
Author: Stefano Baghino <[email protected]>
Date: 2016-01-29T11:35:44Z
[FLINK-2021] Restored source reading methods in Scala examples, introduced
case classes
commit 567a3e01d18919ab4f570398de0ef7a0002d1a2d
Author: Stefano Baghino <[email protected]>
Date: 2016-01-29T11:39:54Z
[FLINK-2021] Documentation updated to reflect changes in the example
commit 179ca81b4f9d41a83c130d5c9edd436a1fdf3a03
Author: Stefano Baghino <[email protected]>
Date: 2016-01-29T13:32:19Z
[FLINK-2021] Indentation problem in docs fixed
commit ef04e9aa13bf85f8d0d8018f7f6db4239ba5a01d
Author: Stefano Baghino <[email protected]>
Date: 2016-01-29T13:33:41Z
[FLINK-2021] ScalaDoc comment re-indented to comply with coding style
commit d163105d0b04fa085853d4f577f55a3ffcdc4e3e
Author: Stefano Baghino <[email protected]>
Date: 2016-01-29T14:50:42Z
[FLINK-2021] Tests updated to reflect usage of ParameterTools in KMeans
commit a715cb150eae18881c106610f02f8ea80f553f92
Author: Stefano Baghino <[email protected]>
Date: 2016-01-29T16:44:20Z
[FLINK-2021] Boy Scout rule: fixed typo in method name
commit 2083bc66efb98e33f07707b5f69d6fa69d8db273
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T13:06:04Z
[FLINK-2021] Reworked Java distcp example to use ParameterTool
commit 844f2dc050c2ac28122b2c306fed637d9dd0e678
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T13:49:55Z
[FLINK-2021] Parameter validation simplified and brought into main method
commit 92dcf3da9f7e79c5f65b23256f1861cb6299d5d1
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T14:00:12Z
[FLINK-2021] Reworked Java connected components example to use ParameterTool
commit 6b1a63667c4c532ff57a0033b431762501a77d20
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T14:31:28Z
[FLINK-2021] Reworked Java linear regression example to use ParameterTool
commit acdafd58beed35e03f1474e7f3d49477d4697adc
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T14:43:00Z
[FLINK-2021] Reworked Java word count examples to use ParameterTool
commit 02bbf7e2ce7708254228dffacfa2506c80c68676
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T15:18:43Z
[FLINK-2021] Reworked Java empty fields count accumulator to use
ParameterTool
commit 261c3f72bbd4423caec5f5cdd66f312a4df33cef
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T15:24:44Z
[FLINK-2021] Reworked Java web log analysis to use ParameterTool
commit f4c4df4f7f92dac7ad1102a5f0c64aa3acfb276f
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T16:06:07Z
[FLINK-2021] Reworked Java TCP-H data querying examples to use ParameterTool
commit f6b830fa4e98aa93c64f991af70cd91731fca286
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T16:29:18Z
[FLINK-2021] Reworked Scala connected components example to use
ParameterTool
commit a53b70b8773c11dd454c1954699bf5fbd5aa50da
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T17:23:19Z
[FLINK-2021] Reworked Java transitive closure example to use ParameterTool
commit e49a1788cc079db7865993046c0d03cd4a862dd1
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T17:26:32Z
[FLINK-2021] Reworked Java triangle enumeration example to use ParameterTool
commit c035c7c888fbeb7bf2e756af419186f89f790bca
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T17:34:12Z
[FLINK-2021] Reworked Java PageRank example to use ParameterTool
commit 7d156e3a4e124e93bf05b40f908a8005605f5bbb
Author: Stefano Baghino <[email protected]>
Date: 2016-02-01T17:42:26Z
[FLINK-2021] Fixed JavaDoc/ScalaDoc for examples reworked so far
----
> 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
> 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)