To create a kafka streams state store in Java I can do this:
final KGroupedStream<String, String> wordCounts = textLines
.flatMapValues(value -> Arrays.asList(pattern.split(value.toLowerCase())))
.groupBy((key, word) -> word);
wordCounts.count(Materialized.<String, Long, KeyValueStore<Bytes, byte[]>>as(WORD_COUNT_STORE));
I am attempting to convert this to Kotlin, like this:
val wordCounts: KGroupedStream<String, String> = textLines
.flatMapValues({value -> value.split("\\W+") })
.groupBy({ _, word -> word})
wordCounts.count(Materialized.<String, Long, KeyValueStore<Bytes, Array<Byte>>>as(WORD_COUNT_STORE))
However, I get the following compiler error:
Interface KeyValueStore does not have constructors
What do I need to do?