Package io.github.kaststream.api.v2
Interface AsyncProcessor
-
- All Superinterfaces:
Serializable
public interface AsyncProcessor extends Serializable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidasyncInvoke(KastRow input, KastResultFuture resultFuture, KastRowBuilder kastRowBuilder)Trigger async operation for each stream input.default voidclose()Tear-down method for the user code (ex: clean resources from open).org.apache.avro.SchemagetProducedType(org.apache.avro.Schema schema)Declare the data type information of the data produced by your function.default voidopen(Map<String,String> configuration, org.apache.avro.Schema schema)Initialization method for the function.default voidopen(Map<String,String> configuration, org.apache.avro.Schema schema, Map<String,Object> meta)Initialization method for the function.
-
-
-
Method Detail
-
getProducedType
org.apache.avro.Schema getProducedType(org.apache.avro.Schema schema)
Declare the data type information of the data produced by your function.- Parameters:
schema- the input row schema- Returns:
- the output row type information
-
open
default void open(Map<String,String> configuration, org.apache.avro.Schema schema) throws Exception
Initialization method for the function. It is called before the actual working method.- Parameters:
configuration- The configuration containing the parameters attached to the contract.schema- the input row schema- Throws:
Exception- The function may throw exceptions which cause the streaming program to fail and go into recovery.
-
open
default void open(Map<String,String> configuration, org.apache.avro.Schema schema, Map<String,Object> meta) throws Exception
Initialization method for the function.- Parameters:
configuration- The configuration containing the parameters attached to the contractschema- the input row schemameta- the udf configuration parameters- Throws:
Exception- The function may throw exceptions which cause the streaming program to fail and go into recovery.
-
close
default void close() throws ExceptionTear-down method for the user code (ex: clean resources from open).- Throws:
Exception- The function may throw exceptions which cause the streaming program to fail and go into recovery.
-
asyncInvoke
void asyncInvoke(KastRow input, KastResultFuture resultFuture, KastRowBuilder kastRowBuilder) throws Exception
Trigger async operation for each stream input.- Parameters:
input- element coming from an upstream taskresultFuture- to be completed with the result data- Throws:
Exception- in case of a user code error. An exception will make the task fail and trigger fail-over process.
-
-