kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: MINOR: Move quickstart under streams
Date Mon, 10 Jul 2017 00:36:14 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.11.0 3d721433d -> 123ffb5e2


MINOR: Move quickstart under streams

Author: Eno Thereska <eno.thereska@gmail.com>

Reviewers: Michael G. Noll <michael@confluent.io>, Damian Guy <damian.guy@gmail.com>,
Guozhang Wang <wangguoz@gmail.com>

Closes #3494 from enothereska/minor-quickstart-docs

rename section name and bold font for section names

(cherry picked from commit 7bfe008ae1a2bb2fa98c3a765be5022e75cd151d)
Signed-off-by: Guozhang Wang <wangguoz@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/123ffb5e
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/123ffb5e
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/123ffb5e

Branch: refs/heads/0.11.0
Commit: 123ffb5e293e6440ba3019693ee8a20dc6d450c5
Parents: 3d72143
Author: Eno Thereska <eno.thereska@gmail.com>
Authored: Sun Jul 9 17:26:11 2017 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Sun Jul 9 17:35:53 2017 -0700

----------------------------------------------------------------------
 docs/documentation/streams/quickstart.html |  19 ++
 docs/quickstart.html                       | 167 +--------------
 docs/streams/architecture.html             |   2 +-
 docs/streams/core-concepts.html            |   4 +-
 docs/streams/developer-guide.html          |   4 +-
 docs/streams/index.html                    |   5 +-
 docs/streams/quickstart.html               | 258 ++++++++++++++++++++++++
 docs/streams/upgrade-guide.html            |   4 +-
 8 files changed, 294 insertions(+), 169 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/123ffb5e/docs/documentation/streams/quickstart.html
----------------------------------------------------------------------
diff --git a/docs/documentation/streams/quickstart.html b/docs/documentation/streams/quickstart.html
new file mode 100644
index 0000000..f69c0d5
--- /dev/null
+++ b/docs/documentation/streams/quickstart.html
@@ -0,0 +1,19 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- should always link the the latest release's documentation -->
+<!--#include virtual="../../streams/quickstart.html" -->

http://git-wip-us.apache.org/repos/asf/kafka/blob/123ffb5e/docs/quickstart.html
----------------------------------------------------------------------
diff --git a/docs/quickstart.html b/docs/quickstart.html
index 40aa2fb..c50df29 100644
--- a/docs/quickstart.html
+++ b/docs/quickstart.html
@@ -280,169 +280,14 @@ data in the topic (or use custom consumer code to process it):
 <h4><a id="quickstart_kafkastreams" href="#quickstart_kafkastreams">Step 8: Use
Kafka Streams to process data</a></h4>
 
 <p>
-Kafka Streams is a client library of Kafka for real-time stream processing and analyzing
data stored in Kafka brokers.
-This quickstart example will demonstrate how to run a streaming application coded in this
library. Here is the gist
-of the <code><a href="https://github.com/apache/kafka/blob/{{dotVersion}}/streams/examples/src/main/java/org/apache/kafka/streams/examples/wordcount/WordCountDemo.java">WordCountDemo</a></code>
example code (converted to use Java 8 lambda expressions for easy reading).
-</p>
-<pre class="brush: bash;">
-// Serializers/deserializers (serde) for String and Long types
-final Serde&lt;String&gt; stringSerde = Serdes.String();
-final Serde&lt;Long&gt; longSerde = Serdes.Long();
-
-// Construct a `KStream` from the input topic ""streams-file-input", where message values
-// represent lines of text (for the sake of this example, we ignore whatever may be stored
-// in the message keys).
-KStream&lt;String, String&gt; textLines = builder.stream(stringSerde, stringSerde,
"streams-file-input");
-
-KTable&lt;String, Long&gt; wordCounts = textLines
-    // Split each text line, by whitespace, into words.
-    .flatMapValues(value -> Arrays.asList(value.toLowerCase().split("\\W+")))
-
-    // Group the text words as message keys
-    .groupBy((key, value) -> value)
-
-    // Count the occurrences of each word (message key).
-    .count("Counts")
-
-// Store the running counts as a changelog stream to the output topic.
-wordCounts.to(stringSerde, longSerde, "streams-wordcount-output");
-</pre>
-
-<p>
-It implements the WordCount
-algorithm, which computes a word occurrence histogram from the input text. However, unlike
other WordCount examples
-you might have seen before that operate on bounded data, the WordCount demo application behaves
slightly differently because it is
-designed to operate on an <b>infinite, unbounded stream</b> of data. Similar
to the bounded variant, it is a stateful algorithm that
-tracks and updates the counts of words. However, since it must assume potentially
-unbounded input data, it will periodically output its current state and results while continuing
to process more data
-because it cannot know when it has processed "all" the input data.
-</p>
-<p>
-As the first step, we will prepare input data to a Kafka topic, which will subsequently be
processed by a Kafka Streams application.
-</p>
-
-<!--
-<pre>
-&gt; <b>./bin/kafka-topics --create \</b>
-            <b>--zookeeper localhost:2181 \</b>
-            <b>--replication-factor 1 \</b>
-            <b>--partitions 1 \</b>
-            <b>--topic streams-file-input</b>
-
-</pre>
-
--->
-
-<pre class="brush: bash;">
-&gt; echo -e "all streams lead to kafka\nhello kafka streams\njoin kafka summit" >
file-input.txt
-</pre>
-Or on Windows:
-<pre class="brush: bash;">
-&gt; echo all streams lead to kafka> file-input.txt
-&gt; echo hello kafka streams>> file-input.txt
-&gt; echo|set /p=join kafka summit>> file-input.txt
-</pre>
-
-<p>
-Next, we send this input data to the input topic named <b>streams-file-input</b>
using the console producer,
-which reads the data from STDIN line-by-line, and publishes each line as a separate Kafka
message with null key and value encoded a string to the topic (in practice,
-stream data will likely be flowing continuously into Kafka where the application will be
up and running):
-</p>
-
-<pre class="brush: bash;">
-&gt; bin/kafka-topics.sh --create \
-    --zookeeper localhost:2181 \
-    --replication-factor 1 \
-    --partitions 1 \
-    --topic streams-file-input
-</pre>
-
-
-<pre class="brush: bash;">
-&gt; bin/kafka-console-producer.sh --broker-list localhost:9092 --topic streams-file-input
< file-input.txt
-</pre>
-
-<p>
-We can now run the WordCount demo application to process the input data:
-</p>
-
-<pre class="brush: bash;">
-&gt; bin/kafka-run-class.sh org.apache.kafka.streams.examples.wordcount.WordCountDemo
-</pre>
-
-<p>
-The demo application will read from the input topic <b>streams-file-input</b>,
perform the computations of the WordCount algorithm on each of the read messages,
-and continuously write its current results to the output topic <b>streams-wordcount-output</b>.
-Hence there won't be any STDOUT output except log entries as the results are written back
into in Kafka.
-The demo will run for a few seconds and then, unlike typical stream processing applications,
terminate automatically.
-</p>
-<p>
-We can now inspect the output of the WordCount demo application by reading from its output
topic:
-</p>
-
-<pre class="brush: bash;">
-&gt; bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 \
-    --topic streams-wordcount-output \
-    --from-beginning \
-    --formatter kafka.tools.DefaultMessageFormatter \
-    --property print.key=true \
-    --property print.value=true \
-    --property key.deserializer=org.apache.kafka.common.serialization.StringDeserializer
\
-    --property value.deserializer=org.apache.kafka.common.serialization.LongDeserializer
-</pre>
-
-<p>
-with the following output data being printed to the console:
-</p>
-
-<pre class="brush: bash;">
-all     1
-lead    1
-to      1
-hello   1
-streams 2
-join    1
-kafka   3
-summit  1
-</pre>
-
-<p>
-Here, the first column is the Kafka message key in <code>java.lang.String</code>
format, and the second column is the message value in <code>java.lang.Long</code>
format.
-Note that the output is actually a continuous stream of updates, where each data record (i.e.
each line in the original output above) is
-an updated count of a single word, aka record key such as "kafka". For multiple records with
the same key, each later record is an update of the previous one.
-</p>
-
-<p>
-The two diagrams below illustrate what is essentially happening behind the scenes.
-The first column shows the evolution of the current state of the <code>KTable&lt;String,
Long&gt;</code> that is counting word occurrences for <code>count</code>.
-The second column shows the change records that result from state updates to the KTable and
that are being sent to the output Kafka topic <b>streams-wordcount-output</b>.
-</p>
-
-<img src="/{{version}}/images/streams-table-updates-02.png" style="float: right; width:
25%;">
-<img src="/{{version}}/images/streams-table-updates-01.png" style="float: right; width:
25%;">
-
-<p>
-First the text line “all streams lead to kafka” is being processed.
-The <code>KTable</code> is being built up as each new word results in a new table
entry (highlighted with a green background), and a corresponding change record is sent to
the downstream <code>KStream</code>.
-</p>
-<p>
-When the second text line “hello kafka streams” is processed, we observe, for the first
time, that existing entries in the <code>KTable</code> are being updated (here:
for the words “kafka” and for “streams”). And again, change records are being sent
to the output topic.
-</p>
-<p>
-And so on (we skip the illustration of how the third line is being processed). This explains
why the output topic has the contents we showed above, because it contains the full record
of changes.
-</p>
-
-<p>
-Looking beyond the scope of this concrete example, what Kafka Streams is doing here is to
leverage the duality between a table and a changelog stream (here: table = the KTable, changelog
stream = the downstream KStream): you can publish every change of the table to a stream, and
if you consume the entire changelog stream from beginning to end, you can reconstruct the
contents of the table.
-</p>
-
-<p>
-Now you can write more input messages to the <b>streams-file-input</b> topic
and observe additional messages added
-to <b>streams-wordcount-output</b> topic, reflecting updated word counts (e.g.,
using the console producer and the
-console consumer, as described above).
+  Kafka Streams is a client library for building mission-critical real-time applications
and microservices,
+  where the input and/or output data is stored in Kafka clusters. Kafka Streams combines
the simplicity of
+  writing and deploying standard Java and Scala applications on the client side with the
benefits of Kafka's
+  server-side cluster technology to make these applications highly scalable, elastic, fault-tolerant,
distributed,
+  and much more. This <a href="/{{version}}/documentation/streams/quickstart">quickstart
example</a> will demonstrate how
+  to run a streaming application coded in this library. 
 </p>
 
-<p>You can stop the console consumer via <b>Ctrl-C</b>.</p>
 
 </script>
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/123ffb5e/docs/streams/architecture.html
----------------------------------------------------------------------
diff --git a/docs/streams/architecture.html b/docs/streams/architecture.html
index f0def6a..70c5c79 100644
--- a/docs/streams/architecture.html
+++ b/docs/streams/architecture.html
@@ -126,7 +126,7 @@
         Note that the cost of task (re)initialization typically depends primarily on the
time for restoring the state by replaying the state stores' associated changelog topics.
         To minimize this restoration time, users can configure their applications to have
<b>standby replicas</b> of local states (i.e. fully replicated copies of the state).
         When a task migration happens, Kafka Streams then attempts to assign a task to an
application instance where such a standby replica already exists in order to minimize
-        the task (re)initialization cost. See <code>num.standby.replicas</code>
in the <a href="/{{version}}/documentation/#streamsconfigs"><b>Kafka Streams Configs</b></a>
Section.
+        the task (re)initialization cost. See <code>num.standby.replicas</code>
in the <a href="/{{version}}/documentation/#streamsconfigs"><b>Kafka Streams Configs</b></a>
section.
     </p>
 
     <div class="pagination">

http://git-wip-us.apache.org/repos/asf/kafka/blob/123ffb5e/docs/streams/core-concepts.html
----------------------------------------------------------------------
diff --git a/docs/streams/core-concepts.html b/docs/streams/core-concepts.html
index b50495d..8efc212 100644
--- a/docs/streams/core-concepts.html
+++ b/docs/streams/core-concepts.html
@@ -131,11 +131,11 @@
         To read more details on how this is done inside Kafka Streams, readers are recommended
to read <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-129%3A+Streams+Exactly-Once+Semantics">KIP-129</a>.
 
         In order to achieve exactly-once semantics when running Kafka Streams applications,
users can simply set the <code>processing.guarantee</code> config value to <b>exactly_once</b>
(default value is <b>at_least_once</b>).
-        More details can be found in the <a href="/{{version}}/documentation#streamsconfigs">Kafka
Streams Configs</a> section.
+        More details can be found in the <a href="/{{version}}/documentation#streamsconfigs"><b>Kafka
Streams Configs</b></a> section.
     </p>
 
     <div class="pagination">
-        <a href="/{{version}}/documentation/streams" class="pagination__btn pagination__btn__prev">Previous</a>
+        <a href="/{{version}}/documentation/streams/quickstart" class="pagination__btn
pagination__btn__prev">Previous</a>
         <a href="/{{version}}/documentation/streams/architecture" class="pagination__btn
pagination__btn__next">Next</a>
     </div>
 </script>

http://git-wip-us.apache.org/repos/asf/kafka/blob/123ffb5e/docs/streams/developer-guide.html
----------------------------------------------------------------------
diff --git a/docs/streams/developer-guide.html b/docs/streams/developer-guide.html
index 6c75172..5ebea1f 100644
--- a/docs/streams/developer-guide.html
+++ b/docs/streams/developer-guide.html
@@ -505,7 +505,7 @@
         A Kafka Streams application is typically running on many instances.
         The state that is locally available on any given instance is only a subset of the
application's entire state.
         Querying the local stores on an instance will, by definition, <i>only return
data locally available on that particular instance</i>.
-        We explain how to access data in state stores that are not locally available in section
<a href="#streams_developer-guide_interactive-queries_discovery">Querying remote state
stores (for the entire application)</a>.
+        We explain how to access data in state stores that are not locally available in section
<a href="#streams_developer-guide_interactive-queries_discovery"><b>Querying remote
state stores</b></a> (for the entire application).
     </p>
 
     <p>
@@ -536,7 +536,7 @@
         This read-only constraint is important to guarantee that the underlying state stores
will never be mutated (e.g. new entries added) out-of-band, i.e. only the corresponding processing
topology of Kafka Streams is allowed to mutate and update the state stores in order to ensure
data consistency.
     </p>
     <p>
-        You can also implement your own <code>QueryableStoreType</code> as described
in section <a href="#streams_developer-guide_interactive-queries_custom-stores#">Querying
local custom stores</a>
+        You can also implement your own <code>QueryableStoreType</code> as described
in section <a href="#streams_developer-guide_interactive-queries_custom-stores#"><b>Querying
local custom stores</b></a>
     </p>
 
     <p>

http://git-wip-us.apache.org/repos/asf/kafka/blob/123ffb5e/docs/streams/index.html
----------------------------------------------------------------------
diff --git a/docs/streams/index.html b/docs/streams/index.html
index 2d30169..7a3c36b 100644
--- a/docs/streams/index.html
+++ b/docs/streams/index.html
@@ -22,6 +22,9 @@
 
     <ol class="toc">
         <li>
+            <a href="/{{version}}/documentation/streams/quickstart">Play with a Streams
Application</a>
+        </li>
+        <li>
             <a href="/{{version}}/documentation/streams/core-concepts">Core Concepts</a>
         </li>
         <li>
@@ -67,7 +70,7 @@
 
     <div class="pagination">
         <a href="#" class="pagination__btn pagination__btn__prev pagination__btn--disabled">Previous</a>
-        <a href="/{{version}}/documentation/streams/core-concepts" class="pagination__btn
pagination__btn__next">Next</a>
+        <a href="/{{version}}/documentation/streams/quickstart" class="pagination__btn
pagination__btn__next">Next</a>
     </div>
 </script>
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/123ffb5e/docs/streams/quickstart.html
----------------------------------------------------------------------
diff --git a/docs/streams/quickstart.html b/docs/streams/quickstart.html
new file mode 100644
index 0000000..521f281
--- /dev/null
+++ b/docs/streams/quickstart.html
@@ -0,0 +1,258 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<script><!--#include virtual="../js/templateData.js" --></script>
+
+<script id="content-template" type="text/x-handlebars-template">
+  <h1>Play with a Streams Application</h1>
+
+<p>
+  This tutorial assumes you are starting fresh and have no existing Kafka or ZooKeeper data.
However, if you have already started Kafka and
+  Zookeeper, feel free to skip the first two steps.
+</p>
+
+  <p>
+ Kafka Streams is a client library for building mission-critical real-time applications and
microservices,
+  where the input and/or output data is stored in Kafka clusters. Kafka Streams combines
the simplicity of
+  writing and deploying standard Java and Scala applications on the client side with the
benefits of Kafka's
+  server-side cluster technology to make these applications highly scalable, elastic, fault-tolerant,
distributed,
+ and much more.
+  </p>
+  <p>
+This quickstart example will demonstrate how to run a streaming application coded in this
library. Here is the gist
+of the <code><a href="https://github.com/apache/kafka/blob/{{dotVersion}}/streams/examples/src/main/java/org/apache/kafka/streams/examples/wordcount/WordCountDemo.java">WordCountDemo</a></code>
example code (converted to use Java 8 lambda expressions for easy reading).
+</p>
+<pre class="brush: java;">
+// Serializers/deserializers (serde) for String and Long types
+final Serde&lt;String&gt; stringSerde = Serdes.String();
+final Serde&lt;Long&gt; longSerde = Serdes.Long();
+
+// Construct a `KStream` from the input topic ""streams-file-input", where message values
+// represent lines of text (for the sake of this example, we ignore whatever may be stored
+// in the message keys).
+KStream&lt;String, String&gt; textLines = builder.stream(stringSerde, stringSerde,
"streams-file-input");
+
+KTable&lt;String, Long&gt; wordCounts = textLines
+    // Split each text line, by whitespace, into words.
+    .flatMapValues(value -> Arrays.asList(value.toLowerCase().split("\\W+")))
+
+    // Group the text words as message keys
+    .groupBy((key, value) -> value)
+
+    // Count the occurrences of each word (message key).
+    .count("Counts")
+
+// Store the running counts as a changelog stream to the output topic.
+wordCounts.to(stringSerde, longSerde, "streams-wordcount-output");
+</pre>
+
+<p>
+It implements the WordCount
+algorithm, which computes a word occurrence histogram from the input text. However, unlike
other WordCount examples
+you might have seen before that operate on bounded data, the WordCount demo application behaves
slightly differently because it is
+designed to operate on an <b>infinite, unbounded stream</b> of data. Similar
to the bounded variant, it is a stateful algorithm that
+tracks and updates the counts of words. However, since it must assume potentially
+unbounded input data, it will periodically output its current state and results while continuing
to process more data
+because it cannot know when it has processed "all" the input data.
+</p>
+<p>
+  As the first step, we will start Kafka (unless you already have it started) and then we
will
+  prepare input data to a Kafka topic, which will subsequently be processed by a Kafka Streams
application.
+
+  <h4><a id="quickstart_streams_download" href="#quickstart_streams_download">Step
1: Download the code</a></h4>
+
+<a href="https://www.apache.org/dyn/closer.cgi?path=/kafka/{{fullDotVersion}}/kafka_2.11-{{fullDotVersion}}.tgz"
title="Kafka downloads">Download</a> the {{fullDotVersion}} release and un-tar it.
+
+<pre class="brush: bash;">
+&gt; tar -xzf kafka_2.11-{{fullDotVersion}}.tgz
+&gt; cd kafka_2.11-{{fullDotVersion}}
+</pre>
+</p>
+<h4><a id="quickstart_streams_startserver" href="#quickstart_streams_startserver">Step
2: Start the Kafka server</a></h4>
+
+<p>
+Kafka uses <a href="https://zookeeper.apache.org/">ZooKeeper</a> so you need
to first start a ZooKeeper server if you don't already have one. You can use the convenience
script packaged with kafka to get a quick-and-dirty single-node ZooKeeper instance.
+</p>
+
+<pre class="brush: bash;">
+&gt; bin/zookeeper-server-start.sh config/zookeeper.properties
+[2013-04-22 15:01:37,495] INFO Reading configuration from: config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
+...
+</pre>
+
+<p>Now start the Kafka server:</p>
+<pre class="brush: bash;">
+&gt; bin/kafka-server-start.sh config/server.properties
+[2013-04-22 15:01:47,028] INFO Verifying properties (kafka.utils.VerifiableProperties)
+[2013-04-22 15:01:47,051] INFO Property socket.send.buffer.bytes is overridden to 1048576
(kafka.utils.VerifiableProperties)
+...
+</pre>
+
+
+<h4><a id="quickstart_streams_prepare" href="#quickstart_streams_prepare">Step
3: Prepare data</a></h4>
+
+<!--
+<pre>
+&gt; <b>./bin/kafka-topics --create \</b>
+            <b>--zookeeper localhost:2181 \</b>
+            <b>--replication-factor 1 \</b>
+            <b>--partitions 1 \</b>
+            <b>--topic streams-file-input</b>
+
+</pre>
+
+-->
+
+<pre class="brush: bash;">
+&gt; echo -e "all streams lead to kafka\nhello kafka streams\njoin kafka summit" >
file-input.txt
+</pre>
+Or on Windows:
+<pre class="brush: bash;">
+&gt; echo all streams lead to kafka> file-input.txt
+&gt; echo hello kafka streams>> file-input.txt
+&gt; echo|set /p=join kafka summit>> file-input.txt
+</pre>
+
+<p>
+Next, we send this input data to the input topic named <b>streams-file-input</b>
using the console producer,
+which reads the data from STDIN line-by-line, and publishes each line as a separate Kafka
message with null key and value encoded a string to the topic (in practice,
+stream data will likely be flowing continuously into Kafka where the application will be
up and running):
+</p>
+
+<pre class="brush: bash;">
+&gt; bin/kafka-topics.sh --create \
+    --zookeeper localhost:2181 \
+    --replication-factor 1 \
+    --partitions 1 \
+    --topic streams-file-input
+</pre>
+
+
+<pre class="brush: bash;">
+&gt; bin/kafka-console-producer.sh --broker-list localhost:9092 --topic streams-file-input
< file-input.txt
+</pre>
+
+<h4><a id="quickstart_streams_process" href="#quickstart_streams_process">Step
4: Process data</a></h4>
+
+<pre class="brush: bash;">
+&gt; bin/kafka-run-class.sh org.apache.kafka.streams.examples.wordcount.WordCountDemo
+</pre>
+
+<p>
+The demo application will read from the input topic <b>streams-file-input</b>,
perform the computations of the WordCount algorithm on each of the read messages,
+and continuously write its current results to the output topic <b>streams-wordcount-output</b>.
+Hence there won't be any STDOUT output except log entries as the results are written back
into in Kafka.
+The demo will run for a few seconds and then, unlike typical stream processing applications,
terminate automatically.
+</p>
+<p>
+We can now inspect the output of the WordCount demo application by reading from its output
topic:
+</p>
+
+<pre class="brush: bash;">
+&gt; bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 \
+    --topic streams-wordcount-output \
+    --from-beginning \
+    --formatter kafka.tools.DefaultMessageFormatter \
+    --property print.key=true \
+    --property print.value=true \
+    --property key.deserializer=org.apache.kafka.common.serialization.StringDeserializer
\
+    --property value.deserializer=org.apache.kafka.common.serialization.LongDeserializer
+</pre>
+
+<p>
+with the following output data being printed to the console:
+</p>
+
+<pre class="brush: bash;">
+all     1
+lead    1
+to      1
+hello   1
+streams 2
+join    1
+kafka   3
+summit  1
+</pre>
+
+<p>
+Here, the first column is the Kafka message key in <code>java.lang.String</code>
format, and the second column is the message value in <code>java.lang.Long</code>
format.
+Note that the output is actually a continuous stream of updates, where each data record (i.e.
each line in the original output above) is
+an updated count of a single word, aka record key such as "kafka". For multiple records with
the same key, each later record is an update of the previous one.
+</p>
+
+<p>
+The two diagrams below illustrate what is essentially happening behind the scenes.
+The first column shows the evolution of the current state of the <code>KTable&lt;String,
Long&gt;</code> that is counting word occurrences for <code>count</code>.
+The second column shows the change records that result from state updates to the KTable and
that are being sent to the output Kafka topic <b>streams-wordcount-output</b>.
+</p>
+
+<img src="/{{version}}/images/streams-table-updates-02.png" style="float: right; width:
25%;">
+<img src="/{{version}}/images/streams-table-updates-01.png" style="float: right; width:
25%;">
+
+<p>
+First the text line “all streams lead to kafka” is being processed.
+The <code>KTable</code> is being built up as each new word results in a new table
entry (highlighted with a green background), and a corresponding change record is sent to
the downstream <code>KStream</code>.
+</p>
+<p>
+When the second text line “hello kafka streams” is processed, we observe, for the first
time, that existing entries in the <code>KTable</code> are being updated (here:
for the words "kafka" and for "streams"). And again, change records are being sent to the
output topic.
+</p>
+<p>
+And so on (we skip the illustration of how the third line is being processed). This explains
why the output topic has the contents we showed above, because it contains the full record
of changes.
+</p>
+
+<p>
+Looking beyond the scope of this concrete example, what Kafka Streams is doing here is to
leverage the duality between a table and a changelog stream (here: table = the KTable, changelog
stream = the downstream KStream): you can publish every change of the table to a stream, and
if you consume the entire changelog stream from beginning to end, you can reconstruct the
contents of the table.
+</p>
+
+<p>
+Now you can write more input messages to the <b>streams-file-input</b> topic
and observe additional messages added
+to <b>streams-wordcount-output</b> topic, reflecting updated word counts (e.g.,
using the console producer and the
+console consumer, as described above).
+</p>
+
+<p>You can stop the console consumer via <b>Ctrl-C</b>.</p>
+
+ <div class="pagination">
+        <a href="/{{version}}/documentation/streams" class="pagination__btn pagination__btn__prev">Previous</a>
+        <a href="/{{version}}/documentation/streams/code-concepts" class="pagination__btn
pagination__btn__next">Next</a>
+    </div>
+</script>
+
+<div class="p-quickstart-streams"></div>
+
+<!--#include virtual="../../includes/_header.htm" -->
+<!--#include virtual="../../includes/_top.htm" -->
+<div class="content documentation documentation--current">
+    <!--#include virtual="../../includes/_nav.htm" -->
+    <div class="right">
+        <!--#include virtual="../../includes/_docs_banner.htm" -->
+        <ul class="breadcrumbs">
+            <li><a href="/documentation">Documentation</a></li>
+            <li><a href="/documentation/streams">Streams</a></li>
+        </ul>
+        <div class="p-content"></div>
+    </div>
+</div>
+<!--#include virtual="../../includes/_footer.htm" -->
+<script>
+$(function() {
+  // Show selected style on nav item
+  $('.b-nav__streams').addClass('selected');
+
+  // Display docs subnav items
+  $('.b-nav__docs').parent().toggleClass('nav__item__with__subs--expanded');
+});
+</script>

http://git-wip-us.apache.org/repos/asf/kafka/blob/123ffb5e/docs/streams/upgrade-guide.html
----------------------------------------------------------------------
diff --git a/docs/streams/upgrade-guide.html b/docs/streams/upgrade-guide.html
index 8ec3e22..f2d9332 100644
--- a/docs/streams/upgrade-guide.html
+++ b/docs/streams/upgrade-guide.html
@@ -27,13 +27,13 @@
     </p>
 
     <p>
-        If you want to upgrade from 0.10.1.x to 0.10.2, see the <a href="/{{version}}/documentation/#upgrade_1020_streams">Upgrade
Section for 0.10.2</a>.
+        If you want to upgrade from 0.10.1.x to 0.10.2, see the <a href="/{{version}}/documentation/#upgrade_1020_streams"><b>Upgrade
Section for 0.10.2</b></a>.
         It highlights incompatible changes you need to consider to upgrade your code and
application.
         See <a href="#streams_api_changes_0102">below</a> a complete list of
0.10.2 API and semantical changes that allow you to advance your application and/or simplify
your code base, including the usage of new features.
     </p>
 
     <p>
-        If you want to upgrade from 0.10.0.x to 0.10.1, see the <a href="/{{version}}/documentation/#upgrade_1010_streams">Upgrade
Section for 0.10.1</a>.
+        If you want to upgrade from 0.10.0.x to 0.10.1, see the <a href="/{{version}}/documentation/#upgrade_1010_streams"><b>Upgrade
Section for 0.10.1</b></a>.
         It highlights incompatible changes you need to consider to upgrade your code and
application.
         See <a href="#streams_api_changes_0101">below</a> a complete list of
0.10.1 API changes that allow you to advance your application and/or simplify your code base,
including the usage of new features.
     </p>


Mime
View raw message