0

How can I use the addJar() method when I implement a stream?

The newJob() uses a DAG:

JobConfig config = new JobConfig();
config.addJar("..");
jet.newJob(dag, config).execute().get();

Streams are changed to DAGs internally:

IMap<String, Long> counts = lines
                .stream()
                .flatMap(..);
HeiSpi
  • 35
  • 1
  • 6
  • The Jet streams API doesn't currently support this. I've createn an issue for this on GitHub: https://github.com/hazelcast/hazelcast-jet/issues/353 – Can Gencer Mar 16 '17 at 07:00

1 Answers1

1

This is possible as of version 0.4

IStreamMap<Integer, Integer> map = jet.getMap(randomString());
range(0, 10).parallel().forEach(i -> map.put(i, i));

JobConfig jobConfig = new JobConfig();
jobConfig.addClass(MyMapper.class);
List<Integer> list = map
    .stream()
    .configure(jobConfig)
    .map(new MyMapper())
    .collect(toList());
Can Gencer
  • 8,822
  • 5
  • 33
  • 52