实现流时如何使用 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());
关于java - 使用流 API 时使用 AddJar() 添加代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42817953/