/** * Creates a new data stream that contains a sequence of numbers. This is a parallel source, * if you manually set the parallelism to {@code 1} * (using {@link org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator#setParallelism(int)}) * the generated sequence of elements is in order. * * @param from * The number to start at (inclusive) * @param to * The number to stop at (inclusive) * @return A data stream, containing all number in the [from, to] interval */ public DataStreamSource<Long> generateSequence(long from, long to) { if (from > to) { throw new IllegalArgumentException("Start of sequence must not be greater than the end"); } return addSource(new StatefulSequenceSource(from, to), "Sequence Source"); }
final OneShotLatch latchToWait2 = new OneShotLatch(); final StatefulSequenceSource source1 = new StatefulSequenceSource(initElement, maxElement); StreamSource<Long, StatefulSequenceSource> src1 = new StreamSource<>(source1); testHarness1.open(); final StatefulSequenceSource source2 = new StatefulSequenceSource(initElement, maxElement); StreamSource<Long, StatefulSequenceSource> src2 = new StreamSource<>(source2); ); final StatefulSequenceSource source3 = new StatefulSequenceSource(initElement, maxElement); StreamSource<Long, StatefulSequenceSource> src3 = new StreamSource<>(source3);
/** * Creates a new data stream that contains a sequence of numbers. This is a parallel source, * if you manually set the parallelism to {@code 1} * (using {@link org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator#setParallelism(int)}) * the generated sequence of elements is in order. * * @param from * The number to start at (inclusive) * @param to * The number to stop at (inclusive) * @return A data stream, containing all number in the [from, to] interval */ public DataStreamSource<Long> generateSequence(long from, long to) { if (from > to) { throw new IllegalArgumentException("Start of sequence must not be greater than the end"); } return addSource(new StatefulSequenceSource(from, to), "Sequence Source"); }
/** * Creates a new data stream that contains a sequence of numbers. This is a parallel source, * if you manually set the parallelism to {@code 1} * (using {@link org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator#setParallelism(int)}) * the generated sequence of elements is in order. * * @param from * The number to start at (inclusive) * @param to * The number to stop at (inclusive) * @return A data stream, containing all number in the [from, to] interval */ public DataStreamSource<Long> generateSequence(long from, long to) { if (from > to) { throw new IllegalArgumentException("Start of sequence must not be greater than the end"); } return addSource(new StatefulSequenceSource(from, to), "Sequence Source"); }
/** * Creates a new data stream that contains a sequence of numbers. This is a parallel source, * if you manually set the parallelism to {@code 1} * (using {@link org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator#setParallelism(int)}) * the generated sequence of elements is in order. * * @param from * The number to start at (inclusive) * @param to * The number to stop at (inclusive) * @return A data stream, containing all number in the [from, to] interval */ public DataStreamSource<Long> generateSequence(long from, long to) { if (from > to) { throw new IllegalArgumentException("Start of sequence must not be greater than the end"); } return addSource(new StatefulSequenceSource(from, to), "Sequence Source"); }
/** * Creates a new data stream that contains a sequence of numbers. This is a parallel source, * if you manually set the parallelism to {@code 1} * (using {@link org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator#setParallelism(int)}) * the generated sequence of elements is in order. * * @param from * The number to start at (inclusive) * @param to * The number to stop at (inclusive) * @return A data stream, containing all number in the [from, to] interval */ public DataStreamSource<Long> generateSequence(long from, long to) { if (from > to) { throw new IllegalArgumentException("Start of sequence must not be greater than the end"); } return addSource(new StatefulSequenceSource(from, to), "Sequence Source"); }