Package io.github.kaststream.api.v2
Interface KastSink
-
- All Superinterfaces:
Serializable
public interface KastSink extends Serializable
Implement this interface to provide your own sink function.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()Tear-down method for the user code (ex: clean resources from open).voidinitializeState()This method is called when the parallel function instance is created during distributed execution.voidinvoke(KastRow row)Trigger operation for each stream input.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.voidsnapshotState()This method is called when a snapshot for a checkpoint is requested.
-
-
-
Method Detail
-
open
default void open(Map<String,String> configuration, org.apache.avro.Schema schema) throws Exception
Initialization method for the function.- Parameters:
configuration- The configuration containing the parameters attached to the contract- 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.
-
invoke
void invoke(KastRow row) throws Exception
Trigger operation for each stream input.- Parameters:
row- row element coming from an upstream task- 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.
-
snapshotState
void snapshotState() throws ExceptionThis method is called when a snapshot for a checkpoint is requested.- Throws:
Exception- The function may throw exceptions which cause the streaming program to fail and go into recovery.
-
initializeState
void initializeState() throws ExceptionThis method is called when the parallel function instance is created during distributed execution. Functions typically set up their state storing data structures in this method.- Throws:
Exception- The function may throw exceptions which cause the streaming program to fail and go into recovery.
-
-