Class AsyncDataStream
java.lang.Object
org.apache.flink.streaming.api.datastream.AsyncDataStream
A helper class to apply
AsyncFunction to a data stream.
DataStream<String> input = ...
AsyncFunction<String, Tuple<String, String>> asyncFunc = ...
AsyncDataStream.orderedWait(input, asyncFunc, timeout, TimeUnit.MILLISECONDS, 100);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumOutput mode for asynchronous operations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> orderedWait(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit) Adds an AsyncWaitOperator.static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> orderedWait(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) Adds an AsyncWaitOperator.static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> orderedWaitWithRetry(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity, AsyncRetryStrategy<OUT> asyncRetryStrategy) Adds an AsyncWaitOperator with an AsyncRetryStrategy to support retry of AsyncFunction.static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> orderedWaitWithRetry(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, AsyncRetryStrategy<OUT> asyncRetryStrategy) Adds an AsyncWaitOperator with an AsyncRetryStrategy to support retry of AsyncFunction.static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> unorderedWait(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit) Adds an AsyncWaitOperator.static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> unorderedWait(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) Adds an AsyncWaitOperator.static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> unorderedWaitWithRetry(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity, AsyncRetryStrategy<OUT> asyncRetryStrategy) Adds an AsyncWaitOperator with an AsyncRetryStrategy to support retry of AsyncFunction.static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> unorderedWaitWithRetry(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, AsyncRetryStrategy<OUT> asyncRetryStrategy) Adds an AsyncWaitOperator with an AsyncRetryStrategy to support retry of AsyncFunction.
-
Constructor Details
-
AsyncDataStream
public AsyncDataStream()
-
-
Method Details
-
unorderedWait
public static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> unorderedWait(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) Adds an AsyncWaitOperator. The order of output stream records may be reordered.- Type Parameters:
IN- Type of input recordOUT- Type of output record- Parameters:
in- InputDataStreamfunc-AsyncFunctiontimeout- for the asynchronous operation to completetimeUnit- of the given timeoutcapacity- The max number of async i/o operation that can be triggered- Returns:
- A new
SingleOutputStreamOperator.
-
unorderedWait
public static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> unorderedWait(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit) Adds an AsyncWaitOperator. The order of output stream records may be reordered.- Type Parameters:
IN- Type of input recordOUT- Type of output record- Parameters:
in- InputDataStreamfunc-AsyncFunctiontimeout- for the asynchronous operation to completetimeUnit- of the given timeout- Returns:
- A new
SingleOutputStreamOperator.
-
orderedWait
public static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> orderedWait(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) Adds an AsyncWaitOperator. The order to process input records is guaranteed to be the same as input ones.- Type Parameters:
IN- Type of input recordOUT- Type of output record- Parameters:
in- InputDataStreamfunc-AsyncFunctiontimeout- for the asynchronous operation to completetimeUnit- of the given timeoutcapacity- The max number of async i/o operation that can be triggered- Returns:
- A new
SingleOutputStreamOperator.
-
orderedWait
public static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> orderedWait(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit) Adds an AsyncWaitOperator. The order to process input records is guaranteed to be the same as input ones.- Type Parameters:
IN- Type of input recordOUT- Type of output record- Parameters:
in- InputDataStreamfunc-AsyncFunctiontimeout- for the asynchronous operation to completetimeUnit- of the given timeout- Returns:
- A new
SingleOutputStreamOperator.
-
unorderedWaitWithRetry
public static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> unorderedWaitWithRetry(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, AsyncRetryStrategy<OUT> asyncRetryStrategy) Adds an AsyncWaitOperator with an AsyncRetryStrategy to support retry of AsyncFunction. The order of output stream records may be reordered.- Type Parameters:
IN- Type of input recordOUT- Type of output record- Parameters:
in- InputDataStreamfunc-AsyncFunctiontimeout- from first invoke to final completion of asynchronous operation, may include multiple retries, and will be reset in case of restarttimeUnit- of the given timeoutasyncRetryStrategy- The strategy of reattempt async i/o operation that can be triggered- Returns:
- A new
SingleOutputStreamOperator.
-
unorderedWaitWithRetry
public static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> unorderedWaitWithRetry(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity, AsyncRetryStrategy<OUT> asyncRetryStrategy) Adds an AsyncWaitOperator with an AsyncRetryStrategy to support retry of AsyncFunction. The order of output stream records may be reordered.- Type Parameters:
IN- Type of input recordOUT- Type of output record- Parameters:
in- InputDataStreamfunc-AsyncFunctiontimeout- from first invoke to final completion of asynchronous operation, may include multiple retries, and will be reset in case of restarttimeUnit- of the given timeoutcapacity- The max number of async i/o operation that can be triggeredasyncRetryStrategy- The strategy of reattempt async i/o operation that can be triggered- Returns:
- A new
SingleOutputStreamOperator.
-
orderedWaitWithRetry
public static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> orderedWaitWithRetry(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, AsyncRetryStrategy<OUT> asyncRetryStrategy) Adds an AsyncWaitOperator with an AsyncRetryStrategy to support retry of AsyncFunction. The order to process input records is guaranteed to be the same as * input ones.- Type Parameters:
IN- Type of input recordOUT- Type of output record- Parameters:
in- InputDataStreamfunc-AsyncFunctiontimeout- from first invoke to final completion of asynchronous operation, may include multiple retries, and will be reset in case of restarttimeUnit- of the given timeoutasyncRetryStrategy- The strategy of reattempt async i/o operation that can be triggered- Returns:
- A new
SingleOutputStreamOperator.
-
orderedWaitWithRetry
public static <IN,OUT> org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator<OUT> orderedWaitWithRetry(org.apache.flink.streaming.api.datastream.DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity, AsyncRetryStrategy<OUT> asyncRetryStrategy) Adds an AsyncWaitOperator with an AsyncRetryStrategy to support retry of AsyncFunction. The order to process input records is guaranteed to be the same as * input ones.- Type Parameters:
IN- Type of input recordOUT- Type of output record- Parameters:
in- InputDataStreamfunc-AsyncFunctiontimeout- from first invoke to final completion of asynchronous operation, may include multiple retries, and will be reset in case of restarttimeUnit- of the given timeoutcapacity- The max number of async i/o operation that can be triggeredasyncRetryStrategy- The strategy of reattempt async i/o operation that can be triggered- Returns:
- A new
SingleOutputStreamOperator.
-