[hotfix][doc] Remove outdated best-practice suggestion to use .withParameters()
This way of passing parameters does not work with the streaming API and is actually confusing for users. This closes #4797. Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/371ec9d6 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/371ec9d6 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/371ec9d6 Branch: refs/heads/master Commit: 371ec9d6f02b031e7bb1a520b49c39833a394973 Parents: a9c13c7 Author: Aljoscha Krettek <[email protected]> Authored: Wed Oct 11 12:10:13 2017 +0200 Committer: zentol <[email protected]> Committed: Wed Oct 11 22:06:59 2017 +0200 ---------------------------------------------------------------------- docs/dev/best_practices.md | 22 ---------------------- 1 file changed, 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/371ec9d6/docs/dev/best_practices.md ---------------------------------------------------------------------- diff --git a/docs/dev/best_practices.md b/docs/dev/best_practices.md index 2a1d32e..24e7091 100644 --- a/docs/dev/best_practices.md +++ b/docs/dev/best_practices.md @@ -111,28 +111,6 @@ DataSet<Tuple2<String, Integer>> counts = text.flatMap(new Tokenizer(parameters) and then use it inside the function for getting values from the command line. - -#### Passing parameters as a `Configuration` object to single functions - -The example below shows how to pass the parameters as a `Configuration` object to a user defined function. - -{% highlight java %} -ParameterTool parameters = ParameterTool.fromArgs(args); -DataSet<Tuple2<String, Integer>> counts = text - .flatMap(new Tokenizer()).withParameters(parameters.getConfiguration()) -{% endhighlight %} - -In the `Tokenizer`, the object is now accessible in the `open(Configuration conf)` method: - -{% highlight java %} -public static final class Tokenizer extends RichFlatMapFunction<String, Tuple2<String, Integer>> { - @Override - public void open(Configuration parameters) throws Exception { - parameters.getInteger("myInt", -1); - // .. do -{% endhighlight %} - - #### Register the parameters globally Parameters registered as global job parameters in the `ExecutionConfig` can be accessed as configuration values from the JobManager web interface and in all functions defined by the user.
