@Override public SplitStream<T> split(OutputSelector<T> outputSelector) { if (requestedSideOutputs.isEmpty()) { wasSplitApplied = true; return super.split(outputSelector); } else { throw new UnsupportedOperationException("getSideOutput() and split() may not be called on the same DataStream. " + "As a work-around, please add a no-op map function before the split() call."); } }
/** * A thin wrapper layer over {@link DataStream#split(OutputSelector)}. * * @param output_selector The user defined {@link OutputSelector} for directing the tuples. * @return The {@link PythonSplitStream} */ public PythonSplitStream split(OutputSelector<PyObject> output_selector) throws IOException { return new PythonSplitStream(this.stream.split(new PythonOutputSelector(output_selector))); }
.map(value -> value); SplitStream<Integer> split = input.split(new OutputSelector<Integer>() { private static final long serialVersionUID = 1L;
@Test public void testSplitAfterSideOutputRejection() { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); DataStreamSource<Integer> src = env.fromElements(0, 0); OutputTag<Integer> outputTag = new OutputTag<Integer>("dummy"){}; OutputSelector<Integer> outputSelector = new DummyOutputSelector<>(); src.getSideOutput(outputTag).split(outputSelector).addSink(new DiscardingSink<>()); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Split after side-outputs are not supported. Splits are deprecated. Please use side-outputs."); env.getStreamGraph(); }
@Test public void testSelectBetweenConsecutiveSplitRejection() { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); DataStreamSource<Integer> src = env.fromElements(0, 0); OutputSelector<Integer> outputSelector = new DummyOutputSelector<>(); src.split(outputSelector).select("dummy").split(outputSelector).addSink(new DiscardingSink<>()); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Consecutive multiple splits are not supported. Splits are deprecated. Please use side-outputs."); env.getStreamGraph(); }
@Test public void testUnionBetweenConsecutiveSplitRejection() { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); DataStreamSource<Integer> src = env.fromElements(0, 0); OutputSelector<Integer> outputSelector = new DummyOutputSelector<>(); src.split(outputSelector).select("dummy").union(src.map(x -> x)).split(outputSelector).addSink(new DiscardingSink<>()); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Consecutive multiple splits are not supported. Splits are deprecated. Please use side-outputs."); env.getStreamGraph(); }
.split(selector) .select("foo") .map(new NoOpIntMap());
SplitStream<Integer> split = unionFilter.split(outputSelector); split.select("dummy").addSink(new DiscardingSink<Integer>()); List<OutputSelector<?>> outputSelectors = env.getStreamGraph().getStreamNode(unionFilter.getId()).getOutputSelectors();
@Override public SplitStream<T> split(OutputSelector<T> outputSelector) { if (requestedSideOutputs.isEmpty()) { wasSplitApplied = true; return super.split(outputSelector); } else { throw new UnsupportedOperationException("getSideOutput() and split() may not be called on the same DataStream. " + "As a work-around, please add a no-op map function before the split() call."); } }
@Override public SplitStream<T> split(OutputSelector<T> outputSelector) { if (requestedSideOutputs.isEmpty()) { wasSplitApplied = true; return super.split(outputSelector); } else { throw new UnsupportedOperationException("getSideOutput() and split() may not be called on the same DataStream. " + "As a work-around, please add a no-op map function before the split() call."); } }