@Override public Dataset<OUT> output(OutputHint... outputHints) { Flow flow = input.getFlow(); MapElements<IN, OUT> map = new MapElements<>(name, flow, input, mapper, Sets.newHashSet(outputHints)); flow.add(map); return map.output(); } }
@Override public Dataset<OUT> output(OutputHint... outputHints) { Flow flow = input.getFlow(); MapElements<IN, OUT> map = new MapElements<>(name, flow, input, mapper, Sets.newHashSet(outputHints)); flow.add(map); return map.output(); } }
@Override public DAG<Operator<?, ?>> getBasicOps() { Flow flow = input.getFlow(); String name = getName() + "::" + "ReduceByKey"; ReduceByKey<IN, ELEM, Void, Void, W> reduce = new ReduceByKey<>(name, flow, input, getKeyExtractor(), null, e -> null, windowing, (CombinableReduceFunction<Void>) e -> null, Collections.emptySet()); MapElements format = new MapElements<>( getName() + "::" + "Map", flow, reduce.output(), Pair::getFirst, getHints()); DAG<Operator<?, ?>> dag = DAG.of(reduce); dag.add(format, reduce); return dag; } }
@Override public DAG<Operator<?, ?>> getBasicOps() { Flow flow = input.getFlow(); String name = getName() + "::" + "ReduceByKey"; ReduceByKey<IN, ELEM, Void, Void, W> reduce = new ReduceByKey<>(name, flow, input, getKeyExtractor(), null, e -> null, windowing, (CombinableReduceFunction<Void>) e -> null, Collections.emptySet()); MapElements format = new MapElements<>( getName() + "::" + "Map", flow, reduce.output(), Pair::getFirst, getHints()); DAG<Operator<?, ?>> dag = DAG.of(reduce); dag.add(format, reduce); return dag; } }
final Flow flow = getFlow(); final MapElements<LEFT, Either<LEFT, RIGHT>> leftMap = new MapElements<>( getName() + "::Map-left", flow, left, Either::left); final MapElements<RIGHT, Either<LEFT, RIGHT>> rightMap = new MapElements<>( getName() + "::Map-right", flow, right, Either::right);
final Flow flow = getFlow(); final MapElements<LEFT, Either<LEFT, RIGHT>> leftMap = new MapElements<>( getName() + "::Map-left", flow, left, Either::left); final MapElements<RIGHT, Either<LEFT, RIGHT>> rightMap = new MapElements<>( getName() + "::Map-right", flow, right, Either::right);
new MapElements<>(getName() + "::MapElements", flow, reduce.output(), e -> Triple.of( e.getFirst(),
new MapElements<>(getName() + "::MapElements", flow, reduce.output(), e -> Triple.of( e.getFirst(),
MapElements<Pair<Object, OUT>, OUT> format = new MapElements<Pair<Object, OUT>, OUT>( getName() + "::MapElements", getFlow(), (Dataset) rbk.output(), Pair::getSecond);
MapElements<Pair<Object, OUT>, OUT> format = new MapElements<Pair<Object, OUT>, OUT>( getName() + "::MapElements", getFlow(), (Dataset) rbk.output(), Pair::getSecond);