I believe that’s correct, although listening for javax.cache.event.EventType.EXPIRED in ContinuousQuery may be more straightforward.
Also, I don’t think you need to disable eager TTL for that. Eager TTL is about when to pay for deletion of the old data – other words, if you specify a TTL with an ExpiryPolicy then your data will be removed sooner or later. If Eager TTL is enabled, you’ll be paying for the deletion periodically (when the cleaning thread wakes up), and if Eager TTL is disabled you’ll pay for it when a new query is executed. I’d suggest to try running both with and without Eager TTL and compare performance. Stan From: svonn Sent: 23 января 2018 г. 21:05 To: [email protected] Subject: Re: Question about persisting stream processing results Hi, It's less about a specific code snipped, more about a conceptual question: How to keep a time window of 5 minutes in Offheap/Inmemory while storing anything older on the harddrive. @Stan: That sounds like possible solution! I'll just have to figure out how to catch, process and delete those properly. The docu for expiry policies says: "Eager TTL Entries that are expired can be removed from cache either eagerly or when they are touched by different cache operations. If there is at least one cache configured with eager TTL enabled, Ignite will create a single thread to clean up expired entries in the background." That "or when they are touched by different cache operations" sounds like I could disable Eager TTL and just set up: ignite.events().localListen(MyListener, EventType.EVT_CACHE_OBJECT_EXPIRED); And it would delete the cache entries after executing the listener, is that correct? - Svonn -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
