IN
- The type of the input elements.OUT
- The type of the returned elements.@PublicEvolving public abstract class RichAsyncFunction<IN,OUT> extends org.apache.flink.api.common.functions.AbstractRichFunction implements AsyncFunction<IN,OUT>
AsyncFunction
. As a RichFunction
, it gives access to the
RuntimeContext
and provides setup and teardown methods:
RichFunction.open(org.apache.flink.configuration.Configuration)
and
RichFunction.close()
.
State related apis in RuntimeContext
are not supported yet because the key may get
changed while accessing states in the working thread.
IterationRuntimeContext.getIterationAggregator(String)
is not supported since the
aggregator may be modified by multiple threads.
构造器和说明 |
---|
RichAsyncFunction() |
限定符和类型 | 方法和说明 |
---|---|
abstract void |
asyncInvoke(IN input,
ResultFuture<OUT> resultFuture)
Trigger async operation for each stream input.
|
void |
setRuntimeContext(org.apache.flink.api.common.functions.RuntimeContext runtimeContext) |
close, getIterationRuntimeContext, getRuntimeContext, open
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
timeout
public void setRuntimeContext(org.apache.flink.api.common.functions.RuntimeContext runtimeContext)
setRuntimeContext
在接口中 org.apache.flink.api.common.functions.RichFunction
setRuntimeContext
在类中 org.apache.flink.api.common.functions.AbstractRichFunction
public abstract void asyncInvoke(IN input, ResultFuture<OUT> resultFuture) throws Exception
AsyncFunction
asyncInvoke
在接口中 AsyncFunction<IN,OUT>
input
- element coming from an upstream taskresultFuture
- to be completed with the result dataException
- in case of a user code error. An exception will make the task fail and
trigger fail-over process.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.