[ 
https://issues.apache.org/jira/browse/KAFKA-3519?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guozhang Wang resolved KAFKA-3519.
----------------------------------
    Resolution: Fixed

Issue resolved by pull request 1204
[https://github.com/apache/kafka/pull/1204]

> Refactor Transformer templates to return the same strong-typed value.
> ---------------------------------------------------------------------
>
>                 Key: KAFKA-3519
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3519
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>            Reporter: Guozhang Wang
>            Assignee: Guozhang Wang
>              Labels: api
>             Fix For: 0.10.0.0
>
>
> Currently the Transformer interface's template is:
> {code}
> R transform(K key, V value);
> {code}
> While all its usage requires a key-value pair, and hence constructing the 
> object as:
> {code}
> new Transformer<K, V, KeyValue<K1, V1>>
> {code}
> Since we expect Transformer to be only used in the Streams DSL, which is 
> supposed to return another key-value pair streams, it's better to define its 
> template just as
> {code}
> public interface Transformer<K, V, K1, V1> {
>     KeyValue<K1, V1> transform(K key, V value);
> }
> {code}
> Also, we can allow punctuate() to also return a nullable KeyValue<K1, V1> 
> pair, and let the implementation to forward to downstream processor only when 
> the returned pair is not null.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to