On 12/01/2009 06:48 PM, Mindaugas Žakšauskas wrote:
Hi there,
I am in process of reviewing Infinispan as, among other things, a
replacement of OSCache library we currently use. So far, it looks very
promising project - well done, guys!
Anyway, one of the features we heavily rely on seems to be missing.
The feature is called "grouping", allowing to "bind" multiple
components and possibly flush them even without knowing of their keys.
E.g.:
Cache cache = ....;
cache.put("key1", "value1", "groupX");
cache.put("key2", "value2", "groupX");
cache.flushGroup("groupX"); // this would evict both key1 and key2
as they belong to groupX
For more details, you can have a look at [1].
I've looked at the Infinispan's roadmap/JIRA, but couldn't find a
single trace of this feature mentioned anywhere.
I haven't tested this but maybe you can put key1 and key2 into an
org.infinispan.atomic.AtomicMap? I.e.
AtomicMap<String, String> map = AtomicMapLookup.getAtomicMap(cache,
"groupX");
map.put("key1", "value1");
map.put("key2", "value2");
// I know these 3 lines above work
And then...
cache.evict("groupX");
// I dunno whether this line would work but if it did, it might do what
// you're after.
I dunno whether this is the preferred or most-performat way to do what
you're after but might work...
You can find examples of AtomicMap usage in the Infinispan testsuite.
My question is, how hard would be to implement this feature without
having much knowledge of Infinispan internals? I've spoken to Manik
Surtani at Devoxx'09 and he guessed this could be done by using
interceptors. I've had a sneak peek at the interceptors package, but
obviously this is still pretty low level stuff, and apart from
javadocs, documentation resources are rather scarce.
Hmmm, you talked to Manik already then. Did he mention anything about
AtomicMap?
Chances are, I could get some time assigned to implement this feature
myself and contribute the code back to the community, but before doing
anything I'd like to know how feasible is this in general. For
example, what would be the best way to fit these parameters in the
current API? How would this work cluster-wise?
Any ideas are appreciated. Thanks in advance!
Regards,
Mindaugas
[1]
http://www.opensymphony.com/oscache/api/com/opensymphony/oscache/base/Cac...
_______________________________________________
infinispan-dev mailing list
infinispan-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache