Package io.github.kaststream.api
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 Modifier and Type Method Description voidclose()Tear-down method for the user code (ex: clean resources from open).voidinitializeState(org.apache.flink.runtime.state.FunctionInitializationContext context)This method is called when the parallel function instance is created during distributed execution.voidinvoke(org.apache.flink.types.Row row, org.apache.flink.streaming.api.functions.sink.SinkFunction.Context context)Trigger operation for each stream input.voidopen(org.apache.flink.configuration.Configuration configuration)Initialization method for the function.voidsnapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext context)This method is called when a snapshot for a checkpoint is requested.
-
-
-
Method Detail
-
open
void open(org.apache.flink.configuration.Configuration configuration) 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.
-
invoke
void invoke(org.apache.flink.types.Row row, org.apache.flink.streaming.api.functions.sink.SinkFunction.Context context) throws ExceptionTrigger operation for each stream input.- Parameters:
row- row element coming from an upstream taskcontext- the SinkFunction.Context- Throws:
Exception- The function may throw exceptions which cause the streaming program to fail and go into recovery.
-
close
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(org.apache.flink.runtime.state.FunctionSnapshotContext context) throws ExceptionThis method is called when a snapshot for a checkpoint is requested.- Parameters:
context- a context that allow you for example to manage state- Throws:
Exception- The function may throw exceptions which cause the streaming program to fail and go into recovery.
-
initializeState
void initializeState(org.apache.flink.runtime.state.FunctionInitializationContext context) 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.- Parameters:
context- a context that allow you for example to manage state- Throws:
Exception- The function may throw exceptions which cause the streaming program to fail and go into recovery.
-
-