[infinispan-issues] [JBoss JIRA] Commented: (ISPN-1198) remove entries from a cache with getBulk operation on RemoteCache after their lifespan ends
Galder Zamarreño (JIRA)
jira-events at lists.jboss.org
Wed Jun 29 10:47:23 EDT 2011
[ https://issues.jboss.org/browse/ISPN-1198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611799#comment-12611799 ]
Galder Zamarreño commented on ISPN-1198:
----------------------------------------
Ok, so the reason this test currently fails is because the Hot Rod server relies on Cache.entrySet() to retrieve all or N entries from the cache, and entrySet is ignoring lifespan/expiry settings. Cache.entrySet() is the right thing to call here cos you can only load whatever is local that HotRod server.
In theory, the right thing to do here would be to fix entrySet() to make sure it does not return back expired entries. However, there's an easy workaround which involves the HotRodEncoder calling keySet() and then calling Cache.get() for each of the keys. This iterative process would probably be slower than getting entrySet() directly.
I'm gonna check how easy it would to fix entrySet() itself first, and if that turns out to be problematic/complex, I'd fall back on the iterative process. Once I've figured this out I'll sort out the JIRA information/description...etc.
> remove entries from a cache with getBulk operation on RemoteCache after their lifespan ends
> -------------------------------------------------------------------------------------------
>
> Key: ISPN-1198
> URL: https://issues.jboss.org/browse/ISPN-1198
> Project: Infinispan
> Issue Type: Feature Request
> Affects Versions: 5.0.0.CR5
> Reporter: Martin Gencur
> Assignee: Galder Zamarreño
> Fix For: 5.0.0.CR7, 5.0.0.FINAL
>
>
> This is related to a getBulk operation on an Infinispan HotRod client.
> Simple test snippet that fails ATM:
> Map<String,String> mapIn = new HashMap<String,String>() ;
> Map<String,String> mapOut = new HashMap<String,String>() ;
> mapOut.put("aKey", "aValue");
> mapOut.put("bKey", "bValue");
> remoteCache.putAll(mapOut, lifespanInSecs, TimeUnit.SECONDS);
> sleepForSecs(lifespanInSecs) ;
> mapIn = remoteCache.getBulk();
> assertTrue(mapIn.size() == 0); //fails, entries are still there
> However, when I call remoteCache.get(<key>); for all the keys and then getBulk, the getBulk return empty map.
> So it seems the get operations cause the entries to be removed from the cache. Please implement this also for getBulk operation or reject it with an explanation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list