From d1d97771431e78a5b41474d94e39a3b3d1bc2951 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 8 Jul 2024 08:57:26 +0200 Subject: [PATCH] popular: 1.4.0 - Switched to Sliding Window --- .../juplo/kafka/wordcount/popular/PopularStreamProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.20.1