ruanwenjun commented on code in PR #1880:
URL:
https://github.com/apache/incubator-seatunnel/pull/1880#discussion_r873121616
##########
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:
This connector is used to mock a stream, I suggest we don't need to add the
`mockDataBounded` config here.
##########
docs/en/connector/source/Fake.mdx:
##########
@@ -116,6 +116,39 @@ source {
FakeSourceStream {
result_table_name = "fake"
field_name = "name,age"
+ //mock_data_enable = true
Review Comment:
Please write correct doc.
--
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]