use of com.hazelcast.jet.stream.DistributedStream in project hazelcast-jet-reference-manual by hazelcast.
the class JUS method s4.
static void s4() {
JetInstance jet = Jet.newJetInstance();
// tag::s4[]
IMap<String, Long> counts = DistributedStream.<String>fromList(jet.getList("text")).flatMap(line -> Stream.of(line.toLowerCase().split("\\W+"))).filter(word -> !word.isEmpty()).collect(DistributedCollectors.groupingByToIMap("counts", wholeItem(), DistributedCollectors.counting()));
// end::s4[]
}
Aggregations