How to trigger only once for each window when using TumblingProcessingTimeWindows?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to trigger only once for each window when using TumblingProcessingTimeWindows?

wanglei2@geekplus.com

Read Kafka message and keyBy by tableName, then write the message list to DataBase with batchUpdate
keyedStream.window(TumblingProcessingTimeWindows.of(Time.seconds(1))).aggregate(new ListAggregate()).addSink(new TemplateMySQLSink());

It seems that for every record comming, the aggregate function will be trigged. 
But I want to trigger only once for every window.
How can i implement this?

Thanks,
Lei