alpinegizmo commented on a change in pull request #31:
URL: https://github.com/apache/flink-training/pull/31#discussion_r696119410



##########
File path: 
common/src/test/java/org/apache/flink/training/exercises/testing/TestSink.java
##########
@@ -0,0 +1,26 @@
+package org.apache.flink.training.exercises.testing;
+
+import org.apache.flink.streaming.api.functions.sink.SinkFunction;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class TestSink<OUT> implements SinkFunction<OUT> {
+
+    // must be static
+    public static final List VALUES = Collections.synchronizedList(new 
ArrayList<>());
+
+    @Override
+    public void invoke(OUT value, Context context) {
+        VALUES.add(value);
+    }
+
+    public Iterable<OUT> results() {
+        return VALUES;
+    }
+
+    public void reset() {
+        VALUES.clear();
+    }
+}

Review comment:
       See the latest commit. Seems to work just fine.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to