Re: what's the example for datastream data generator?
Posted by
Shengkai Fang on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Guide-on-writing-Flink-plugins-tp38488p38506.html
Hi, I think you can take a look at org.apache.flink.table.planner.plan.nodes.common.CommonPhysicalTableSourceScan#createSourceTransformation, which will tell you how to get transformations by source function and stream execution environment. In datastream api, we also have a DataGen that is org.apache.flink.streaming.api.functions.source.datagen.DataGeneratorSource. Therefore, I think we can do as follows to create a DataGen:
new DataStream(env, env.addSource(new DataGeneratorSource(RandomGenerator.longGenerator(0, 1000))).getTransformation())
I am not sure whether this is the best method. Welcome for any options.
I want to simulate the scene"back pressure"could you tell me
what's the example for datastream datagen?
Thanks for your help.