0

I have an Apache ignite cache that has key as String and value as Set of Boolean and a expiration timestamp. I need to remove the cache item from cache based on this expiration timestamp. How to achieve this?

As far as I know, Ignite allows cache expiration on cache level and not cache item level.

1 Answer 1

1

Yes, you are correct that TTL is set on the cache level, and a cache entry can be subject to purging once the time specified by TTL passes after the creation (or last access, or modification, according to what's configured) of the entry. You can set EagerTtl to true https://ignite.apache.org/docs/latest/configuring-caches/expiry-policies#eager-ttl, which will allocate a single thread to the task of traversing the cache in search of expired entries to be purged. However, there is no guarantee that the entry would be purged immediately once TTL is reached, because only a single thread is allocated for the purpose. Otherwise (if EagerTtl=false) the expired entry would be purged only when the next operation is performed on the entry. Note besides that in case of using Native persistence the removal of the entries from the partition files does not free disk space. However, that space can be used for writing subsequent entries. https://ignite.apache.org/docs/latest/configuring-caches/expiry-policies#overview

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.