Setting TTL/Record Expiry in hazelcast

夙愿已清 提交于 2019-12-23 17:51:45

问题


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


回答1:


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)



来源:https://stackoverflow.com/questions/37248404/setting-ttl-record-expiry-in-hazelcast

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!