Class DeclarationContext
- java.lang.Object
-
- org.apache.flink.runtime.asyncprocessing.declare.DeclarationContext
-
public class DeclarationContext extends Object
A context to declare parts of process in user-defined function/operator.
-
-
Constructor Summary
Constructors Constructor Description DeclarationContext(DeclarationManager manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T,U,V>
NamedBiFunction<T,U,V>declare(String name, org.apache.flink.util.function.BiFunctionWithException<T,U,V,? extends Exception> callback)
Declare a callback with a name.<T,V>
NamedFunction<T,V>declare(String name, org.apache.flink.util.function.FunctionWithException<T,V,? extends Exception> callback)
Declare a callback with a name.<T> NamedConsumer<T>
declare(String name, org.apache.flink.util.function.ThrowingConsumer<T,? extends Exception> callback)
Declare a callback with a name.<T,U,V>
NamedBiFunction<T,U,V>declare(org.apache.flink.util.function.BiFunctionWithException<T,U,V,? extends Exception> callback)
Declare a callback with an automatically assigned name.<T,V>
NamedFunction<T,V>declare(org.apache.flink.util.function.FunctionWithException<T,V,? extends Exception> callback)
Declare a callback with an automatically assigned name.<T> NamedConsumer<T>
declare(org.apache.flink.util.function.ThrowingConsumer<T,? extends Exception> callback)
Declare a callback with an automatically assigned name.<IN> DeclarationChain.DeclarationStage<IN>
declareChain()
Declaring a processing in chain-style.<T> ContextVariable<T>
declareVariable(Supplier<T> initializer)
Declare a variable that will keep value across callback with same context.<T> DeclaredVariable<T>
declareVariable(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, String name, Supplier<T> initialValue)
Declare a variable that will keep value across callback with same context.
-
-
-
Constructor Detail
-
DeclarationContext
public DeclarationContext(DeclarationManager manager)
-
-
Method Detail
-
declare
public <T> NamedConsumer<T> declare(String name, org.apache.flink.util.function.ThrowingConsumer<T,? extends Exception> callback) throws DeclarationException
Declare a callback with a name.- Throws:
DeclarationException
-
declare
public <T,V> NamedFunction<T,V> declare(String name, org.apache.flink.util.function.FunctionWithException<T,V,? extends Exception> callback) throws DeclarationException
Declare a callback with a name.- Throws:
DeclarationException
-
declare
public <T,U,V> NamedBiFunction<T,U,V> declare(String name, org.apache.flink.util.function.BiFunctionWithException<T,U,V,? extends Exception> callback) throws DeclarationException
Declare a callback with a name.- Throws:
DeclarationException
-
declare
public <T> NamedConsumer<T> declare(org.apache.flink.util.function.ThrowingConsumer<T,? extends Exception> callback) throws DeclarationException
Declare a callback with an automatically assigned name.- Throws:
DeclarationException
-
declare
public <T,V> NamedFunction<T,V> declare(org.apache.flink.util.function.FunctionWithException<T,V,? extends Exception> callback) throws DeclarationException
Declare a callback with an automatically assigned name.- Throws:
DeclarationException
-
declare
public <T,U,V> NamedBiFunction<T,U,V> declare(org.apache.flink.util.function.BiFunctionWithException<T,U,V,? extends Exception> callback) throws DeclarationException
Declare a callback with an automatically assigned name.- Throws:
DeclarationException
-
declareVariable
public <T> DeclaredVariable<T> declareVariable(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, String name, @Nullable Supplier<T> initialValue) throws DeclarationException
Declare a variable that will keep value across callback with same context.- Type Parameters:
T
- The type of value.- Parameters:
serializer
- the serializer of variable.name
- the name.initialValue
- the initializer of variable. Can be null if no need to initialize.- Throws:
DeclarationException
-
declareVariable
public <T> ContextVariable<T> declareVariable(@Nullable Supplier<T> initializer) throws DeclarationException
Declare a variable that will keep value across callback with same context. This value cannot be serialized into checkpoint.- Type Parameters:
T
- The type of value.- Parameters:
initializer
- the initializer of variable. Can be null if no need to initialize.- Throws:
DeclarationException
-
declareChain
public <IN> DeclarationChain.DeclarationStage<IN> declareChain() throws DeclarationException
Declaring a processing in chain-style. This method start a chain with an input type.- Type Parameters:
IN
- the in type of the first block.- Returns:
- the chain itself.
- Throws:
DeclarationException
-
-