使用流 API 时使用 AddJar() 添加代码?

Add code with AddJar() when using streams API?

如何在实现流时使用 addJar() 方法?

newJob() 使用 DAG:

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

流在内部更改为 DAG:

IMap<String, Long> counts = lines
                .stream()
                .flatMap(..);

从 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());