You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by mj...@apache.org on 2020/05/15 22:29:06 UTC
[kafka] branch trunk updated: KAFKA-8611: update documentation for
KIP-221 (#8558)
This is an automated email from the ASF dual-hosted git repository.
mjsax pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 8a0fcd1 KAFKA-8611: update documentation for KIP-221 (#8558)
8a0fcd1 is described below
commit 8a0fcd1695253fd4b8bb252576525219e668957e
Author: Levani Kokhreidze <le...@transferwise.com>
AuthorDate: Sat May 16 01:28:23 2020 +0300
KAFKA-8611: update documentation for KIP-221 (#8558)
Reviewer: Matthias J. Sax <ma...@confluent.io>
---
docs/streams/developer-guide/dsl-api.html | 19 +++++++++++++++++++
docs/streams/upgrade-guide.html | 5 +++++
2 files changed, 24 insertions(+)
diff --git a/docs/streams/developer-guide/dsl-api.html b/docs/streams/developer-guide/dsl-api.html
index db4940f..79c1ec6 100644
--- a/docs/streams/developer-guide/dsl-api.html
+++ b/docs/streams/developer-guide/dsl-api.html
@@ -863,6 +863,25 @@
</div>
</td>
</tr>
+ <tr class="row-even">
+ <td><p class="first"><strong>Repartition</strong></p>
+ <ul class="last simple">
+ <li>KStream → KStream</li>
+ </ul>
+ </td>
+ <td>
+ <p class="first">Manually trigger repartitioning of the stream with desired number of partitions. (<a class="reference external" href="/{{version}}/javadoc/org/apache/kafka/streams/kstream/KStream.html#repartition--">details</a>)</p>
+
+ <code><span class="pre">repartition()</span></code> is similar to <code><span class="pre">through()</span></code> however Kafka Streams will manage the topic for you.
+ Generated topic is treated as internal topic, as a result data will be purged automatically as any other internal repartition topic.
+ In addition, you can specify the desired number of partitions, which allows to easily scale in/out downstream sub-topologies.
+ <code><span class="pre">repartition()</span></code> operation always triggers repartitioning of the stream, as a result it can be used with embedded Processor API methods (like <code><span class="pre">transform()</span></code> et al.) that do not trigger auto repartitioning when key changing operation is performed beforehand.
+
+ <div class="last highlight-java"><div class="highlight"><pre><span></span><span class="n">KStream</span><span class="o"><</span><span class="kt">byte</span><span class="o">[],</span> <span class="n">String</span><span class="o">></span> <span class="n">stream</span> <span class="o">=</span> <span class="o">... ;</span>
+<span class="n">KStream</span><span class="o"><</span><span class="kt">byte</span><span class="o">[],</span> <span class="n">String</span><span class="o">></span> <span class="n">repartitionedStream</span> <span class="o">=</span> <span class="n">stream</span><span class="o">.</span><span class="na">repartition</span><span class="o">(</span><span class="n">Repartitioned</span><span class="o">.</span><span class="na">numberOfPartitions</span><span class="o">(</span><span class="s">1 [...]
+ </div>
+ </td>
+ </tr>
</tbody>
</table>
</div>
diff --git a/docs/streams/upgrade-guide.html b/docs/streams/upgrade-guide.html
index fe32a4a..1a203b9 100644
--- a/docs/streams/upgrade-guide.html
+++ b/docs/streams/upgrade-guide.html
@@ -94,6 +94,11 @@
new value <code>"exactly_once_beta"</code>.
Note that you need brokers with version 2.5 or newer to use this feature.
</p>
+ <p>
+ As of 2.6.0 Kafka Streams offers a new <code>KStream.repartition()</code> operator (as per <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-221%3A+Enhance+DSL+with+Connecting+Topic+Creation+and+Repartition+Hint">KIP-221</a>).
+ <code>KStream.repartition()</code> is similar to <code>KStream.through()</code>, however Kafka Streams will manage the topic for you.
+ Refer to the <a href="/{{version}}/documentation/streams/developer-guide/dsl-api.html">developer guide</a> for more details.
+ </p>
<h3><a id="streams_api_changes_250" href="#streams_api_changes_250">Streams API changes in 2.5.0</a></h3>
<p>