Re: Can I set an expiry policy for some specify entry?

2015-12-01 Thread Lin
v";<vers...@gridgain.com>; Date: Tue, Dec 1, 2015 08:33 PM To: "user"<user@ignite.apache.org>; Subject: Re: Can I set an expiry policy for some specify entry? Hi Lin, An expiry policy is working for all values, which were added through cacheWithExpiryPolicy ac

Re: Can I set an expiry policy for some specify entry?

2015-12-01 Thread Lin
Hi all, We can easily set an expiry policy for any entry. Sorry to Anton and Vladimir , you are right. Talk is cheap, show you the code... the test case public static void testPut1() throws Exception { getCache().put("key","val", TimeUnit.SECONDS.toMillis(1)); String val =

Re: Can I set an expiry policy for some specify entry?

2015-12-01 Thread Anton Vinogradov
Lin, As you can see at example you can use cache.withExpiryPolicy() to gain cache wrapper with specific ExpiryPolicy. This policy will be used during operations on this cache wrapper, only. You can create as much wrappers as you need and put/get/etc entries using them. I recomend you to use

Can I set an expiry policy for some specify entry?

2015-11-30 Thread Lin
Hi, I have read the docs on jcache expiry policies, the policy will be used for each operation invoked on the returned cache instance. IgniteCache cache = cache.withExpiryPolicy( new CreatedExpiryPolicy(new Duration(TimeUnit.SECONDS, 5))); and searched the nabble faq