Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting TTL/Record Expiry in hazelcast

Is there any way to set TTL per record in hazelcast DB?Preferably in Map or Ringbuffer.

like image 937
user2966021 Avatar asked Jan 06 '23 01:01

user2966021


1 Answers

I guess you're looking for that:

IMap::put(Key, Value, TTL, TimeUnit)

IMap:

http://docs.hazelcast.org/docs/3.6/manual/html-single/index.html#evicting-specific-entries

http://docs.hazelcast.org/docs/3.6/javadoc/com/hazelcast/core/IMap.html#put(K,%20V,%20long,%20java.util.concurrent.TimeUnit)

http://docs.hazelcast.org/docs/3.6/javadoc/com/hazelcast/core/IMap.html#putAsync(K,%20V,%20long,%20java.util.concurrent.TimeUnit)

http://docs.hazelcast.org/docs/3.6/javadoc/com/hazelcast/core/IMap.html#putIfAbsent(K,%20V,%20long,%20java.util.concurrent.TimeUnit)

http://docs.hazelcast.org/docs/3.6/javadoc/com/hazelcast/core/IMap.html#putTransient(K,%20V,%20long,%20java.util.concurrent.TimeUnit)

http://docs.hazelcast.org/docs/3.6/javadoc/com/hazelcast/core/IMap.html#set(K,%20V,%20long,%20java.util.concurrent.TimeUnit)

like image 50
noctarius Avatar answered Apr 08 '23 02:04

noctarius