ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitriy Setrakyan <dsetrak...@apache.org>
Subject Counting characters example in Ignite in Java8
Date Wed, 04 Mar 2015 01:41:22 GMT
Collection<String> words = Arrays.asList("How Many Characters".split(" "));

// Each closure is given a single word and returns the word's length.
// Each closure will be executed on a different cluster member.
Collection<Integer> res = ignite.compute().apply(String::length, words);

int sum = res.stream().mapToInt(Integer::intValue).sum();

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message