From: Kai Moritz Date: Thu, 20 Jun 2024 19:50:15 +0000 (+0200) Subject: popular: 1.1.1 - Refined output JSON X-Git-Tag: popular-1.1.1 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=8af553a2b1cae0b7f5c9d9c63023b47af89bd5ab;p=demos%2Fkafka%2Fwordcount popular: 1.1.1 - Refined output JSON --- diff --git a/pom.xml b/pom.xml index a9ba9e1..0c99200 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ de.juplo.kafka.wordcount popular - 1.1.0 + 1.1.1 Wordcount-Popular-Words Query stream-processor that gives access to the most popular words diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/WindowedWord.java b/src/main/java/de/juplo/kafka/wordcount/popular/WindowedWord.java index df988fb..b759f2e 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/WindowedWord.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/WindowedWord.java @@ -14,5 +14,5 @@ public class WindowedWord { ZonedDateTime start; ZonedDateTime end; - String word; + String key; } diff --git a/src/main/java/de/juplo/kafka/wordcount/popular/WordCounter.java b/src/main/java/de/juplo/kafka/wordcount/popular/WordCounter.java index c94ec0e..bc4243e 100644 --- a/src/main/java/de/juplo/kafka/wordcount/popular/WordCounter.java +++ b/src/main/java/de/juplo/kafka/wordcount/popular/WordCounter.java @@ -10,6 +10,6 @@ import lombok.NoArgsConstructor; @AllArgsConstructor(staticName = "of") public class WordCounter { - String word; + String key; long counter; } diff --git a/src/test/java/de/juplo/kafka/wordcount/popular/TestData.java b/src/test/java/de/juplo/kafka/wordcount/popular/TestData.java index fa6a258..4ac9fd4 100644 --- a/src/test/java/de/juplo/kafka/wordcount/popular/TestData.java +++ b/src/test/java/de/juplo/kafka/wordcount/popular/TestData.java @@ -192,7 +192,7 @@ class TestData windowedWord.setStart(ZonedDateTime.ofInstant(outputWindowedWord.getStart(), CLOCK.getZone())); windowedWord.setEnd(ZonedDateTime.ofInstant(outputWindowedWord.getEnd(), CLOCK.getZone())); - windowedWord.setWord(outputWindowedWord.getWord()); + windowedWord.setKey(outputWindowedWord.getKey()); return windowedWord; } @@ -211,7 +211,7 @@ class TestData WordCounter counter) { OutputWordCounter outputWordCounter = OutputWordCounter.of( - word.getWord(), + word.getKey(), counter.getCounter()); assertWordCountEqualsWordCountFromLastMessage(word, outputWordCounter); } diff --git a/src/test/java/de/juplo/kafka/wordcount/stats/OutputWindowedWord.java b/src/test/java/de/juplo/kafka/wordcount/stats/OutputWindowedWord.java index 1589ea0..470f727 100644 --- a/src/test/java/de/juplo/kafka/wordcount/stats/OutputWindowedWord.java +++ b/src/test/java/de/juplo/kafka/wordcount/stats/OutputWindowedWord.java @@ -14,5 +14,5 @@ public class OutputWindowedWord { Instant start; Instant end; - String word; + String key; } diff --git a/src/test/java/de/juplo/kafka/wordcount/stats/OutputWordCounter.java b/src/test/java/de/juplo/kafka/wordcount/stats/OutputWordCounter.java index f132707..ce8a764 100644 --- a/src/test/java/de/juplo/kafka/wordcount/stats/OutputWordCounter.java +++ b/src/test/java/de/juplo/kafka/wordcount/stats/OutputWordCounter.java @@ -10,6 +10,6 @@ import lombok.NoArgsConstructor; @AllArgsConstructor(staticName = "of") public class OutputWordCounter { - String word; + String key; long counter; }