Class DeclarationContext
java.lang.Object
org.apache.flink.runtime.asyncprocessing.declare.DeclarationContext
A context to declare parts of process in user-defined function/operator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<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 a callback with an automatically assigned name.<T,V> NamedFunction<T, V> Declare a callback with an automatically assigned name.<T> NamedConsumer<T>Declare a callback with an automatically assigned name.<IN> DeclarationChain<IN>.DeclarationStage<IN>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 Details
-
DeclarationContext
-
-
Method Details
-
declare
public <T> NamedConsumer<T> declare(String name, org.apache.flink.util.function.ThrowingConsumer<T, ? extends Exception> callback) throws DeclarationExceptionDeclare 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, throws DeclarationException? extends Exception> callback) Declare a callback with a name.- Throws:
DeclarationException
-
declare
public <T,U, NamedBiFunction<T,V> U, declareV> (String name, org.apache.flink.util.function.BiFunctionWithException<T, U, throws DeclarationExceptionV, ? extends Exception> callback) 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 DeclarationExceptionDeclare 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, throws DeclarationException? extends Exception> callback) Declare a callback with an automatically assigned name.- Throws:
DeclarationException
-
declare
public <T,U, NamedBiFunction<T,V> U, declareV> (org.apache.flink.util.function.BiFunctionWithException<T, U, throws DeclarationExceptionV, ? extends Exception> callback) 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
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
-