TTL value for an entry in map is prolonged for every update of that entry

87 views
Skip to first unread message

Edward E

unread,
Oct 25, 2015, 10:10:35 AM10/25/15
to Hazelcast

Hi,

I am trying to use Hazelcast Map and found that "Expiration time for an entry = Last Updated Time + TTL". But i want to have it as "Expiration Time for an entry= Creation Time + TTL". Can some one suggest how to achieve this functionality.

This behavior was existing previously, any reason why it got changed?

Thanks.

Peter Veentjer

unread,
Oct 25, 2015, 12:49:17 PM10/25/15
to haze...@googlegroups.com
Which HZ version did you use?

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at http://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/c2c12feb-11fe-45f5-a5d3-6dd6dc16b0d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jaromir Hamala

unread,
Oct 25, 2015, 1:45:36 PM10/25/15
to Hazelcast
Hello,

this is indeed a desired behaviour. See this for details: https://github.com/hazelcast/hazelcast/issues/3920 I agree it should be very precisely documented. 
I am not sure if there is any way to achieve the behaviour you would like to have. I'll ask around and let you know if I discover something.  

Cheers,
Jaromir

Edward E

unread,
Oct 25, 2015, 2:09:58 PM10/25/15
to Hazelcast
Hi peter, 

I am using version 3.4.2.

Thanks.

dsukho...@gmail.com

unread,
Oct 26, 2015, 5:24:53 AM10/26/15
to Hazelcast
It would be very usefull to be able to register your own custom eviction policy. That would solve a lot of similair questions.

Thanks, Denis.

Edward E

unread,
Oct 26, 2015, 9:51:03 AM10/26/15
to Hazelcast
Hi Denis,

By custom eviction policy, do you mean to handle the expiration of keys by myself instead of hazelcast?



On Sunday, October 25, 2015 at 7:40:35 PM UTC+5:30, Edward E wrote:

dsukho...@gmail.com

unread,
Oct 26, 2015, 10:08:00 AM10/26/15
to Hazelcast
Hi Edward,

Well, in some cases that would be very helpful. For instance, my cached entities are related one on another. Like a tree structure. And I need to evict parent entity together with all its children, regardles of TTL or cache size. Same common eviction inteface with registered custom implementation could help in your case too.

Thanks, Denis.

Nils Kilden-Pedersen

unread,
Oct 28, 2015, 11:38:43 AM10/28/15
to Hazelcast, dsukho...@gmail.com
How do you update your entries? By get/set or using an EntryProcessor?

Nitin Singh

unread,
Oct 4, 2023, 3:06:40 AM10/4/23
to Hazelcast
I know am years late to this thread, but  Expiration Time = Creation Time + TTL   made more sense instead of  Expiration Time = Last Update Time + TTL given how we also have Max Idle Seconds; which calculates Expiration Time from last read or write. 

For anyone still looking for Creation Time behavior, may have to do the evictions (manually) by tracking and comparing against custom creationAtTime variable or rely on per-entry-stats-enabled creation at time and doing . I also see support for Custom Eviction Policy but have not tried that yet. Not sure if it would fire without setting any ttl/idle seconds or max size
Reply all
Reply to author
Forward
0 new messages