result = AsyncDataStream.orderedWait( inputStream, function, result = AsyncDataStream.unorderedWait( inputStream, function,
/** * Add an AsyncWaitOperator. The order to process input records is guaranteed to be the same as * input ones. * * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param capacity The max number of async i/o operation that can be triggered * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> orderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) { return addOperator(in, func, timeUnit.toMillis(timeout), capacity, OutputMode.ORDERED); }
public static DataStream getSideJoinDataStream(DataStream inputStream, String sideType, String sqlRootDir, RowTypeInfo rowTypeInfo, JoinInfo joinInfo, List<FieldInfo> outFieldInfoList, SideTableInfo sideTableInfo) throws Exception { AsyncReqRow asyncDbReq = loadAsyncReq(sideType, sqlRootDir, rowTypeInfo, joinInfo, outFieldInfoList, sideTableInfo); //TODO How much should be set for the degree of parallelism? Timeout? capacity settings? return AsyncDataStream.orderedWait(inputStream, asyncDbReq, 10000, TimeUnit.MILLISECONDS, asyncCapacity) .setParallelism(sideTableInfo.getParallelism()); } }
DataStream<Integer> orderedResult = AsyncDataStream.orderedWait( input, function, DataStream<Integer> unorderedResult = AsyncDataStream.unorderedWait( input, function,
/** * Add an AsyncWaitOperator. The order of output stream records may be reordered. * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> unorderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit) { return addOperator( in, func, timeUnit.toMillis(timeout), DEFAULT_QUEUE_CAPACITY, OutputMode.UNORDERED); }
input = AsyncDataStream.orderedWait( input, new LazyAsyncFunction(), input = AsyncDataStream.orderedWait( input, new MyAsyncFunction(), input = AsyncDataStream.unorderedWait( input, new MyAsyncFunction(),
/** * Add an AsyncWaitOperator. The order of output stream records may be reordered. * * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param capacity The max number of async i/o operation that can be triggered * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> unorderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) { return addOperator(in, func, timeUnit.toMillis(timeout), capacity, OutputMode.UNORDERED); }
result = AsyncDataStream.orderedWait( inputStream, function, result = AsyncDataStream.unorderedWait( inputStream, function,
/** * Add an AsyncWaitOperator. The order to process input records is guaranteed to be the same as * input ones. * * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> orderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit) { return addOperator( in, func, timeUnit.toMillis(timeout), DEFAULT_QUEUE_CAPACITY, OutputMode.ORDERED); } }
/** * Add an AsyncWaitOperator. The order of output stream records may be reordered. * * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param capacity The max number of async i/o operation that can be triggered * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> unorderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) { return addOperator(in, func, timeUnit.toMillis(timeout), capacity, OutputMode.UNORDERED); }
/** * Add an AsyncWaitOperator. The order of output stream records may be reordered. * * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param capacity The max number of async i/o operation that can be triggered * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> unorderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) { return addOperator(in, func, timeUnit.toMillis(timeout), capacity, OutputMode.UNORDERED); }
/** * Add an AsyncWaitOperator. The order to process input records is guaranteed to be the same as * input ones. * * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param capacity The max number of async i/o operation that can be triggered * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> orderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) { return addOperator(in, func, timeUnit.toMillis(timeout), capacity, OutputMode.ORDERED); }
/** * Add an AsyncWaitOperator. The order of output stream records may be reordered. * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> unorderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit) { return addOperator( in, func, timeUnit.toMillis(timeout), DEFAULT_QUEUE_CAPACITY, OutputMode.UNORDERED); }
/** * Add an AsyncWaitOperator. The order of output stream records may be reordered. * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> unorderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit) { return addOperator( in, func, timeUnit.toMillis(timeout), DEFAULT_QUEUE_CAPACITY, OutputMode.UNORDERED); }
/** * Add an AsyncWaitOperator. The order of output stream records may be reordered. * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> unorderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit) { return addOperator( in, func, timeUnit.toMillis(timeout), DEFAULT_QUEUE_CAPACITY, OutputMode.UNORDERED); }
/** * Add an AsyncWaitOperator. The order of output stream records may be reordered. * * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param capacity The max number of async i/o operation that can be triggered * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> unorderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) { return addOperator(in, func, timeUnit.toMillis(timeout), capacity, OutputMode.UNORDERED); }
/** * Add an AsyncWaitOperator. The order to process input records is guaranteed to be the same as * input ones. * * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> orderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit) { return addOperator( in, func, timeUnit.toMillis(timeout), DEFAULT_QUEUE_CAPACITY, OutputMode.ORDERED); } }
/** * Add an AsyncWaitOperator. The order to process input records is guaranteed to be the same as * input ones. * * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param capacity The max number of async i/o operation that can be triggered * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> orderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) { return addOperator(in, func, timeUnit.toMillis(timeout), capacity, OutputMode.ORDERED); }
/** * Add an AsyncWaitOperator. The order to process input records is guaranteed to be the same as * input ones. * * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param capacity The max number of async i/o operation that can be triggered * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> orderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) { return addOperator(in, func, timeUnit.toMillis(timeout), capacity, OutputMode.ORDERED); }
/** * Add an AsyncWaitOperator. The order to process input records is guaranteed to be the same as * input ones. * * @param in Input {@link DataStream} * @param func {@link AsyncFunction} * @param timeout for the asynchronous operation to complete * @param timeUnit of the given timeout * @param <IN> Type of input record * @param <OUT> Type of output record * @return A new {@link SingleOutputStreamOperator}. */ public static <IN, OUT> SingleOutputStreamOperator<OUT> orderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit) { return addOperator( in, func, timeUnit.toMillis(timeout), DEFAULT_QUEUE_CAPACITY, OutputMode.ORDERED); } }