From c554972144fab1e927ce85b36a33f96ebc214fd6 Mon Sep 17 00:00:00 2001
From: Vahid Hashemian Step 8: Use
of the
WordCountDemo example code (converted to use Java 8 lambda expressions for easy reading).
-KTablewordCounts = textLines +KTable<String, Long> wordCounts = textLines // Split each text line, by whitespace, into words. .flatMapValues(value -> Arrays.asList(value.toLowerCase().split("\\W+"))) @@ -389,7 +389,7 @@ Step 8: Use
-Here, the first column is the Kafka message key, and the second column is the message value, both in in java.lang.String format.
+Here, the first column is the Kafka message key, and the second column is the message value, both in java.lang.String format.
Note that the output is actually a continuous stream of updates, where each data record (i.e. each line in the original output above) is
an updated count of a single word, aka record key such as "kafka". For multiple records with the same key, each later record is an update of the previous one.