You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by tropicalpb <ni...@qq.com> on 2017/01/11 06:31:10 UTC

Streaming Sliding Window question

Hi,  I went thru the docs and videos on youtube, but it is unclear whether
Ignite can do streaming sliding window calculation per Affinity key.  For
example, if there are data streaming in the format of (user, timestamp,
action) in and I'd like calculate whether the user's last five action
contains a particular value every time a new user action data comes in.  Is
there a way to do this in ignite or should I do this using another stream
product and use Ignite as a caching layer?

thanks



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Streaming-Sliding-Window-question-tp10022.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Streaming Sliding Window question

Posted by vkulichenko <va...@gmail.com>.
Sounds like you can simply store all 5 latest entries as a single entry and
update the collection atomically using entry processor and invoke() method
(check current size within entry processor and remove oldest element if
needed). Once updated, you can do the computation. Will this work for you?

Another possible approach is to implement custom eviction policy. Similar to
LruEvictionPolicy, but with a queue per affinity key.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Streaming-Sliding-Window-question-tp10022p10045.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.