kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: MINOR: update streams.html with KStream API changes
Date Tue, 21 Jun 2016 19:16:56 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 971676881 -> d546aa292


MINOR: update streams.html with KStream API changes

mjsax guozhangwang

Author: Damian Guy <damian.guy@gmail.com>

Reviewers: Matthias J. Sax, Guozhang Wang

Closes #1534 from dguy/update-streams-doc


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/d546aa29
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/d546aa29
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/d546aa29

Branch: refs/heads/trunk
Commit: d546aa292aa8710f4285cef4e89c75b44d24a8b0
Parents: 9716768
Author: Damian Guy <damian.guy@gmail.com>
Authored: Tue Jun 21 12:16:52 2016 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Tue Jun 21 12:16:52 2016 -0700

----------------------------------------------------------------------
 docs/streams.html | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/d546aa29/docs/streams.html
----------------------------------------------------------------------
diff --git a/docs/streams.html b/docs/streams.html
index 4a3f7aa..cd2cd93 100644
--- a/docs/streams.html
+++ b/docs/streams.html
@@ -298,10 +298,11 @@ based on them.
 
 <pre>
     // written in Java 8+, using lambda expressions
-    KTable<Windowed<String>, Long> counts = source1.aggregateByKey(
+    KTable<Windowed<String>, Long> counts = source1.groupBykey().aggregate(
         () -> 0L,  // initial value
         (aggKey, value, aggregate) -> aggregate + 1L,   // aggregating value
-        HoppingWindows.of("counts").with(5000L).every(1000L), // intervals in milliseconds
+        TimeWindows.of("counts", 5000L).advanceBy(1000L), // intervals in milliseconds
+        Serdes.Long() // serde for aggregated value
     );
 
     KStream<String, String> joined = source1.leftJoin(source2,
@@ -338,4 +339,4 @@ Kafka Streams provides a convenience method called <code>through</code>:
 Besides defining the topology, developers will also need to configure their applications
 in <code>StreamsConfig</code> before running it. A complete list of
 Kafka Streams configs can be found <a href="#streamsconfigs"><b>here</b></a>.
-</p>
\ No newline at end of file
+</p>


Mime
View raw message