From 84de7466757c86e968eb9ddce8ba7865821e9091 Mon Sep 17 00:00:00 2001 From: Zhai Jia Date: Thu, 26 May 2016 23:24:40 +0800 Subject: [PATCH] [FLINK-3979] add import for code --- docs/quickstart/run_example_quickstart.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/quickstart/run_example_quickstart.md b/docs/quickstart/run_example_quickstart.md index 0d5e919b64c78..0939297d511fb 100644 --- a/docs/quickstart/run_example_quickstart.md +++ b/docs/quickstart/run_example_quickstart.md @@ -315,6 +315,13 @@ result .addSink(new FlinkKafkaProducer08<>("localhost:9092", "wiki-result", new SimpleStringSchema())); {% endhighlight %} +The related classes also need to be imported: +{% highlight java %} +import org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer08; +import org.apache.flink.streaming.util.serialization.SimpleStringSchema; +import org.apache.flink.api.common.functions.MapFunction; +{% endhighlight %} + Note how we first transform the Stream of `Tuple2` to a Stream of `String` using a MapFunction. We are doing this because it is easier to write plain strings to Kafka. Then, we create a Kafka sink. You might have to adapt the hostname and port to your setup. `"wiki-result"` @@ -382,4 +389,4 @@ and, for example, see the number of processed elements: Example Job View -This concludes our little tour of Flink. If you have any questions, please don't hesitate to ask on our [Mailing Lists](http://flink.apache.org/community.html#mailing-lists). \ No newline at end of file +This concludes our little tour of Flink. If you have any questions, please don't hesitate to ask on our [Mailing Lists](http://flink.apache.org/community.html#mailing-lists).