Github user EronWright commented on a diff in the pull request:
https://github.com/apache/flink/pull/4616#discussion_r140108752
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/SinkFunction.java
---
@@ -31,10 +31,50 @@
public interface SinkFunction<IN> extends Function, Serializable {
/**
- * Function for standard sink behaviour. This function is called for
every record.
+ * @deprecated Use {@link #invoke(Object, Context)}.
+ */
+ @Deprecated
+ default void invoke(IN value) throws Exception {}
+
+ /**
+ * Writes the given value to the sink. This function is called for
every record.
+ *
+ * <p>You have to override this method when implementing a {@code
SinkFunction}, this is a
+ * {@code default} method for backward compatibility with the old-style
method only.
*
* @param value The input record.
- * @throws Exception
+ * @param 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.
*/
- void invoke(IN value) throws Exception;
+ default void invoke(IN value, Context context) throws Exception {
+ invoke(value);
+ }
+
+ /**
+ * Context that {@link SinkFunction SinkFunctions } can use for getting
additional data about
--- End diff --
Is the link in this comment well-formed?
---