You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/04/08 18:34:25 UTC
[jira] [Commented] (KAFKA-3519) Refactor Transformer templates to
return the same strong-typed value.
[ https://issues.apache.org/jira/browse/KAFKA-3519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15232454#comment-15232454 ]
ASF GitHub Bot commented on KAFKA-3519:
---------------------------------------
GitHub user guozhangwang opened a pull request:
https://github.com/apache/kafka/pull/1204
KAFKA-3519: Refactor Transformer's transform / punctuate to return nullable values
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/guozhangwang/kafka KTransformR
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/1204.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #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)