Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E4207200B13 for ; Tue, 31 May 2016 16:41:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E2CBE1609AD; Tue, 31 May 2016 14:41:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 46041160A46 for ; Tue, 31 May 2016 16:41:25 +0200 (CEST) Received: (qmail 54827 invoked by uid 500); 31 May 2016 14:41:24 -0000 Mailing-List: contact commits-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 commits@flink.apache.org Received: (qmail 54806 invoked by uid 99); 31 May 2016 14:41:24 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2016 14:41:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 46030DFFD8; Tue, 31 May 2016 14:41:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sewen@apache.org To: commits@flink.apache.org Date: Tue, 31 May 2016 14:41:26 -0000 Message-Id: <0cc02304f9be4f90a0aa6b5401e68218@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/4] flink git commit: [FLINK-3979] [docs] Add import statements for last code sample in the quickstart docs. archived-at: Tue, 31 May 2016 14:41:26 -0000 [FLINK-3979] [docs] Add import statements for last code sample in the quickstart docs. This closes #2038 Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/ad52a5f0 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/ad52a5f0 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/ad52a5f0 Branch: refs/heads/master Commit: ad52a5f0cebe6e5d593be0ae40656b28470af106 Parents: 5b02879 Author: Zhai Jia Authored: Thu May 26 23:24:40 2016 +0800 Committer: Stephan Ewen Committed: Tue May 31 16:39:56 2016 +0200 ---------------------------------------------------------------------- docs/quickstart/run_example_quickstart.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/ad52a5f0/docs/quickstart/run_example_quickstart.md ---------------------------------------------------------------------- diff --git a/docs/quickstart/run_example_quickstart.md b/docs/quickstart/run_example_quickstart.md index 0d5e919..0939297 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).