This content has been marked as final.
Show 3 replies
-
1. Re: ExpirationAlgorithm - Eviction Policy
manik Feb 16, 2009 5:22 AM (in response to thangamani_r)For each node in the region you need to add an attribute which uses ExpirationAlgorithmConfig.EXPIRATION_KEY as key and a long which specifies a time-to-live for that node.
See ExpirationAlgorithm javadocs. -
2. Re: ExpirationAlgorithm - Eviction Policy
thangamani_r Feb 24, 2009 3:56 AM (in response to thangamani_r)Hi Manik,
The javadoc mentions about expiration config being set programatically.Cache cache; Fqn fqn1 = Fqn.fromString("/node/1"); Long future = new Long(System.currentTimeMillis() + 2000); cache.put(fqn1, ExpirationConfiguration.EXPIRATION_KEY, future); cache.put(fqn1, "foo"); assertTrue(cache.get(fqn1) != null); Thread.sleep(5000); // 5 seconds assertTrue(cache.get(fqn1) == null);
I would like to know if it is possible to set it programatically only ?
or can we set it through the config file. What would be the setting in the config file. Is there any example for the config file setting?
Even the programatic approach as mentioned in the docs does not evict the node.. -
3. Re: ExpirationAlgorithm - Eviction Policy
manik Feb 24, 2009 4:24 AM (in response to thangamani_r)Programmatically only, and it needs to be in a region that has the expiration eviction algorithm configured.