Class AsyncDataStream
- java.lang.Object
-
- org.apache.flink.streaming.api.datastream.AsyncDataStream
-
@PublicEvolving public class AsyncDataStream extends Object
A helper class to applyAsyncFunction
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 Classes Modifier and Type Class Description static class
AsyncDataStream.OutputMode
Output mode for asynchronous operations.
-
Constructor Summary
Constructors Constructor Description AsyncDataStream()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.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.
-
-
-
Method Detail
-
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
- InputDataStream
func
-AsyncFunction
timeout
- 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
- InputDataStream
func
-AsyncFunction
timeout
- 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
- InputDataStream
func
-AsyncFunction
timeout
- 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
- InputDataStream
func
-AsyncFunction
timeout
- 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
- InputDataStream
func
-AsyncFunction
timeout
- 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
- InputDataStream
func
-AsyncFunction
timeout
- 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
- InputDataStream
func
-AsyncFunction
timeout
- 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
- InputDataStream
func
-AsyncFunction
timeout
- 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
.
-
-