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

Matthias J. Sax commented on KAFKA-4772:
----------------------------------------

This JIRA is not about any public API changes (see KAFKA-4830). Any public API 
change requires a KIP, and we do have a KIP for the other JIRA: 
https://cwiki.apache.org/confluence/display/KAFKA/KIP-132%3A+Augment+KStream.print+to+allow+extra+parameters+in+the+printed+string

This PR is only about internal code refactoring. {{KStreamImpl#print()}} uses 
{{KeyValuePrinter}} as processor. But with {{#peek()}} we don't need this 
processor anymore, but can simple call {{#peek()}} with an appropriate UDF.

Furthermore, the class {{KStreamForeach}} can be replaced by {{KStreamPeek}} if 
we add a flag to {{KStreamPeek}} about forwarding the data or not.

Does this make sense?

> 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
>            Assignee: james chien
>            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