标签: hazelcast hazelcast-imap
有没有办法在hazelcast DB中为每条记录设置TTL?最好是Map或Ringbuffer。
答案 0 :(得分:5)
我猜你正在寻找:
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)