Parallelism with onTimer() in connectedStream

Posted by Maminspapin on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Parallelism-with-onTimer-in-connectedStream-tp43996.html

Hello!

I have a ConnectedStream consists of two DataStreams:
- user (dataStream)
- event (dataStream)

It allows me to use storages of that DataStreams to manage information of
user (user info depends on event of this user) and events:
- users (store)
- events (store)

So:
- user info is changed by every event of this user
- event of user is need to be processed considering user info. It means if
we actually need to process an event. If yes, so we should register some
work using timers (not processing immidiately, but after some period using
rules and user info)
- onTimer() method use users and events stores to proper processing the
logic

Problem:
When I use parallelism =1, then onTimer() method works correctly.
But I want to have a possibility to scaling this work. Thus in my code I set
parallelism in 3.
And there are problems...
- If two users registered on the same time, onTimer() can process only one
of them but twice in two different threads.

How can I adjust the correct work in parallelism>1?

Thanks!



--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/