[ 
https://issues.apache.org/jira/browse/KAFKA-4772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15931227#comment-15931227
 ] 

ASF GitHub Bot commented on KAFKA-4772:
---------------------------------------

GitHub user backender opened a pull request:

    https://github.com/apache/kafka/pull/2703

    KAFKA-4772: Use peek to implement print

    **Tackles [KAFKA-4772](https://issues.apache.org/jira/browse/KAFKA-4772) 
and was previously discussed in https://github.com/apache/kafka/pull/2669**
    
    The functionality of `KeyValuePrinter` is replaced with `PrintAction` which 
implements `ForeachAction` and can be passed to `KStreamPeek`. We therefore can 
get rid of `KeyValuePrinter`.
    My only concern is that `ForeachAction` does not have access to the 
`ProcessorContext`, which means, that the topic name cannot be used within the 
deserialization process. For now, the a null value is filled in as a 
placeholder for topic.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/delftswa2017/kafka fix-KAFKA-4772-notopic

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/2703.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 #2703
    
----
commit 46d5f20eb1ee69abc24b05f890eca620d2399b17
Author: Marc Juchli <m...@marcjuch.li>
Date:   2017-03-18T14:00:59Z

    Use peek to implement print
    
    The functionaliy of KeyValuePrinter is replaced with PrintAction which
    implements ForeachAction and can be passed to KStreamPeek.
    We therefore can get rid of KeyValuePrinter.
    My only concern is that ForeachAction does not have access to the
    ProcessorContext, which means, that the topic name cannot be used within
    the deserialization process.
    For now, the a null value is filled in as a placeholder for topic.

----


> Exploit #peek to implement #print() and other methods
> -----------------------------------------------------
>
>                 Key: KAFKA-4772
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4772
>             Project: Kafka
>          Issue Type: Improvement
>          Components: streams
>            Reporter: Matthias J. Sax
>            Priority: Minor
>              Labels: beginner, newbie
>
> From: https://github.com/apache/kafka/pull/2493#pullrequestreview-22157555
> Things that I can think of:
> - print / writeAsTest can be a special impl of peek; KStreamPrint etc can be 
> removed.
> - consider collapse KStreamPeek with KStreamForeach with a flag parameter 
> indicating if the acted key-value pair should still be forwarded.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to