This post originated from an RSS feed registered with Java Buzz
by Talip Ozturk.
Original Post: Distributed Queue and Map with Eviction Support
Feed Title: Shared Memory
Feed URL: http://www.jroller.com/talipozturk/feed/entries/rss
Feed Description: about java, jcache, jini, javaspaces, distributed data structures and a little bit of me and life.
I feel quite productive these days. Spring effect on me probably. I finished adding eviction support to both queue and map. Eviction for queue is time based. You specify TTL (TimeToLive) for the entries in your queue. Entries (objects) older than TTL will get auto-evicted from the queue. For the distributed map, eviction can be based on LRU (Least Recently Used) or LFU (Least Frequently Used). Just specify your eviction policy and max-size in the hazelcast.xml, you are good to go.
Eviction is implemented in a way that there is no pausing when evicting. LRU and LFU ordering happens during get/update operations in a very optimized way. Overhead is quite ignorable. Do not hesitate to use it :)
Now we have evictable distributed map, it means Hazelcast can easily become a level 2 cache for Hibernate! We are also very close to 1.6 release, which means we will start working on load/store interface for persistence; the most requested song of the day!