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


##########
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:
   There exist some deprecated api in ST, we are developing the new ST API. 
Before our new API finished, it's better to keep the current API.



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