What is an adequate topic configuration for the topic word-count-output?
StreamsBuilder builder = new StreamsBuilder();
KStream<String, String> textLines = builder.stream("word-count-input");
KTable<String, Long> wordCounts = textLines
.mapValues(textLine -> textLine.toLowerCase())
.flatMapValues(textLine -> Arrays.asList(textLine.split("W+")))
.selectKey((key, word) -> word)
.groupByKey()
.count(Materialized.as("Counts"));
wordCounts.toStream().to("word-count-output", Produced.with(Serdes.String(), Serdes.Long()));
builder.build();
What is an adequate topic configuration for the topic word-count-output?
A . max.message.bytes=10000000
B . cleanup.policy=delete
C . compression.type=lz4
D . cleanup.policy=compact
Answer: D
Explanation:
Result is aggregated into a table with key as the unique word and value its frequency. We have to enable log compaction for this topic to align the topic’s cleanup policy with KTable semantics.
Latest CCDAK Dumps Valid Version with 150 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund