Interface SinkFunction<IN>
- Type Parameters:
IN- Input type parameter.
- All Superinterfaces:
org.apache.flink.api.common.functions.Function,Serializable
- All Known Implementing Classes:
CollectSinkFunction,OutputFormatSinkFunction,PrintSinkFunction,RichSinkFunction,SocketClientSink
@Internal
@Deprecated
public interface SinkFunction<IN>
extends org.apache.flink.api.common.functions.Function, Serializable
Deprecated.
Interface for implementing user defined sink functionality.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDeprecated.Context thatSinkFunctionscan use for getting additional data about an input record. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidfinish()Deprecated.This method is called at the end of data processing.default voidDeprecated.default voidinvoke(IN value, SinkFunction.Context context) Deprecated.Writes the given value to the sink.default voidwriteWatermark(org.apache.flink.api.common.eventtime.Watermark watermark) Deprecated.Writes the given watermark to the sink.
-
Method Details
-
invoke
Deprecated.- Throws:
Exception
-
invoke
Deprecated.Writes the given value to the sink. This function is called for every record.You have to override this method when implementing a
SinkFunction, this is adefaultmethod for backward compatibility with the old-style method only.- Parameters:
value- The input record.context- Additional context about the input record.- Throws:
Exception- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-
writeWatermark
default void writeWatermark(org.apache.flink.api.common.eventtime.Watermark watermark) throws Exception Deprecated.Writes the given watermark to the sink. This function is called for every watermark.This method is intended for advanced sinks that propagate watermarks.
- Parameters:
watermark- The watermark.- Throws:
Exception- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-
finish
Deprecated.This method is called at the end of data processing.The method is expected to flush all remaining buffered data. Exceptions will cause the pipeline to be recognized as failed, because the last data items are not processed properly. You may use this method to flush remaining buffered elements in the state into transactions which you can commit in the last checkpoint.
NOTE:This method does not need to close any resources. You should release external resources in the
AbstractRichFunction.close()method.- Throws:
Exception- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-
Sinkinterface instead.