You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2018/09/24 16:26:10 UTC
[kafka] branch trunk updated: KAFKA-7430: Improve Transformer
interface JavaDoc (#5675)
This is an automated email from the ASF dual-hosted git repository.
guozhang 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 86b4d9d KAFKA-7430: Improve Transformer interface JavaDoc (#5675)
86b4d9d is described below
commit 86b4d9d58fc990939b654382adde7d86a4f4c24c
Author: Eugen Feller <ef...@users.noreply.github.com>
AuthorDate: Mon Sep 24 09:25:54 2018 -0700
KAFKA-7430: Improve Transformer interface JavaDoc (#5675)
This PR improves the JavaDoc of the transformer interface.
Reviewers: Guozhang Wang <gu...@confluent.io>, John Roesler <jo...@confluent.io>
---
.../main/java/org/apache/kafka/streams/kstream/Transformer.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/streams/src/main/java/org/apache/kafka/streams/kstream/Transformer.java b/streams/src/main/java/org/apache/kafka/streams/kstream/Transformer.java
index 0ab3469..b7487b8 100644
--- a/streams/src/main/java/org/apache/kafka/streams/kstream/Transformer.java
+++ b/streams/src/main/java/org/apache/kafka/streams/kstream/Transformer.java
@@ -71,9 +71,13 @@ public interface Transformer<K, V, R> {
* attached} to this operator can be accessed and modified
* arbitrarily (cf. {@link ProcessorContext#getStateStore(String)}).
* <p>
- * If more than one output record should be forwarded downstream {@link ProcessorContext#forward(Object, Object)}
+ * If only one record should be forward downstream, {@code transform} can return a new {@link KeyValue}. If
+ * more than one output record should be forwarded downstream, {@link ProcessorContext#forward(Object, Object)}
* and {@link ProcessorContext#forward(Object, Object, To)} can be used.
- * If record should not be forwarded downstream, {@code transform} can return {@code null}.
+ * If no record should be forwarded downstream, {@code transform} can return {@code null}.
+ *
+ * Note that returning a new {@link KeyValue} is merely for convenience. The same can be achieved by using
+ * {@link ProcessorContext#forward(Object, Object)} and returning {@code null}.
*
* @param key the key for the record
* @param value the value for the record