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

Guozhang Wang resolved KAFKA-4720.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 0.10.3.0

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

> Add KStream.peek(ForeachAction<K,V>)
> ------------------------------------
>
>                 Key: KAFKA-4720
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4720
>             Project: Kafka
>          Issue Type: New Feature
>          Components: streams
>    Affects Versions: 0.10.1.1
>            Reporter: Steven Schlansker
>              Labels: needs-kip
>             Fix For: 0.10.3.0
>
>
> Java's Stream provides a handy peek method that observes elements in the 
> stream without transforming or filtering them.  While you can emulate this 
> functionality with either a filter or map, peek provides potentially useful 
> semantic information (doesn't modify the stream) and is much more concise.
> Example usage: using Dropwizard Metrics to provide event counters
> {code}
> KStream<Integer, String> s = ...;
> s.map(this::mungeData)
>  .peek((i, s) -> metrics.noteMungedEvent(i, s))
>  .filter(this::hadProcessingError)
>  .print();
> {code}



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

Reply via email to