KAFKA-7430: Improve Transformer interface JavaDoc (#5675)

This PR improves the JavaDoc of the transformer interface. 

Reviewers: Guozhang Wang <guozhang@confluent.io>, John Roesler <john@confluent.io>
This commit is contained in:
Eugen Feller 2018-09-24 09:25:54 -07:00 committed by Guozhang Wang
parent 95f9622cce
commit 86b4d9d58f
1 changed files with 6 additions and 2 deletions

View File

@ -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