Reputation: 12601
I am considering how to use Apache Flink for a voting system I’m currently developing. I am a complete newbie to Flink and any help would be appreciated.
The requirements are:
In my understanding, Flink’s stream processing is for a real-time processing of infinite streams, while batch processing is for a non-real-time processing of finite streams.
How can I apply Flink to my requirement, which is a real-time processing of finite streams?
Upvotes: 0
Views: 669
Reputation: 18987
Flink's DataStream API can process events of finite streams without any problems. The DataStream program will simply terminate when the stream reached its end.
You can simulate this behavior if you use a SocketTextStreamFunction
to read text data from a socket. Once you close the socket, the program will terminate. Alternatively, you can also read data from a file which is also some kind of finite stream. However, keep in mind that incomplete windows will not be automatically evaluated. So you have to make sure that you do not lose data in windows if you use them.
Upvotes: 1