From: Kai Moritz Date: Mon, 8 Jul 2024 06:57:26 +0000 (+0200) Subject: popular: 1.4.0 - Switched to Sliding Window X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=d1d97771431e78a5b41474d94e39a3b3d1bc2951;p=demos%2Fkafka%2Fwordcount popular: 1.4.0 - Switched to Sliding Window --- diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java b/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java index 74aa2c6..367277b 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/PopularStreamProcessor.java @@ -59,7 +59,7 @@ public class PopularStreamProcessor .map((key, userWord) -> new KeyValue<>(Word.of(userWord.getWord()), Word.of(userWord.getWord()))) .peek((key, value) -> log.info("mapped: {} -> {}", key, value)) .groupByKey() - .windowedBy(TimeWindows.ofSizeWithNoGrace(WINDOW_SIZE)) + .windowedBy(SlidingWindows.ofTimeDifferenceWithNoGrace(WINDOW_SIZE)) .count( Materialized .as(windowBytesStoreSupplier)