mosence commented on code in PR #1880:
URL: 
https://github.com/apache/incubator-seatunnel/pull/1880#discussion_r873151387


##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-fake/src/main/java/org/apache/seatunnel/flink/fake/source/FakeSourceStream.java:
##########
@@ -73,11 +135,23 @@ public String getPluginName() {
 
     @Override
     public void run(SourceFunction.SourceContext<Row> ctx) throws Exception {
-        while (running) {
-            int randomNum = (int) (1 + Math.random() * NAME_ARRAY.length);
-            Row row = Row.of(NAME_ARRAY[randomNum - 1], 
System.currentTimeMillis());
-            ctx.collect(row);
-            Thread.sleep(TimeUnit.SECONDS.toMillis(1));
+        if (!mockDataEnable) {
+            while (running) {
+                int randomNum = (int) (1 + Math.random() * NAME_ARRAY.length);
+                Row row = Row.of(NAME_ARRAY[randomNum - 1], 
System.currentTimeMillis());
+                ctx.collect(row);
+                Thread.sleep(TimeUnit.SECONDS.toMillis(1));
+            }
+        } else {
+            int index = 0;
+            while (running && index < mockDataSize){

Review Comment:
   I have a question, newest version(>1.12) flink api, the batch api is 
deprecated.
   
[https://nightlies.apache.org/flink/flink-docs-master/docs/dev/dataset/overview/](https://nightlies.apache.org/flink/flink-docs-master/docs/dev/dataset/overview/).
   These can both all in one, Why the stream & batch must be two connector?



-- 
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