[infinispan-dev] Redesigning CacheStore and CacheLoader SPIs

Dan Berindei dan.berindei at gmail.com
Tue Apr 10 14:34:24 EDT 2012


Seems pretty much the same as the Coherence one:
https://github.com/jsr107/jsr107spec/blob/master/src/main/java/javax/cache/CacheLoader.java
https://github.com/jsr107/jsr107spec/blob/master/src/main/java/javax/cache/CacheWriter.java

I'm not sure where you're supposed the keys from in order to do any
preloading, so maybe we still need another method to load random
entries.
I'd remove loadAllKeys, I think state transfer can just assume that
entries on disk are not in memory when passivation and that entries on
disk are also in memory when passivation is disabled (so no need for a
memory-only state transfer).
containsKey is only used when removing keys and most cache stores can
remove stuff without the extra check, so that should probably go as
well - although it's probably one of the more straightforward methods
:)

In CacheStore, the toStream and fromStream methods aren't even used
any more (used to be called by state transfer).

Cheers
Dan


On Tue, Apr 10, 2012 at 6:07 PM, Galder Zamarreño <galder at redhat.com> wrote:
> Btw, a few months back I saw this forum post: https://community.jboss.org/thread/171515
>
> The guy's considering implementing cache loader and it's a bit confused with all methods that need to implement, and points to Coherence's cache loader interface which simply has 2 methods:
> http://download.oracle.com/otn_hosted_doc/coherence/330/com/tangosol/net/cache/CacheLoader.html
>
> And cache store has just 4 methods:
> http://download.oracle.com/otn_hosted_doc/coherence/330/com/tangosol/net/cache/CacheStore.html
>
> I haven't checked what the JSR-107 interfaces look like but let's try to keep things simple.
>
> On Apr 2, 2012, at 2:47 PM, Manik Surtani wrote:
>
>> I know this is much needed, and perhaps 6.0 may be the time to do this.  Do we have a list of things we want to change here?
>>
>> On the back of https://community.jboss.org/message/726337#726337 it would seem that we need the ability to pass in the ConsistentHash to the CacheLoader when loading entries, so that if the cache store is shared, it can selectively load entries targeted to the node in question.  Either that, or to be able to call CacheLoader.load(CacheLoaderFilter) where CacheLoaderFilter would expose a shouldLoad(Object key).
>>
>> Other thoughts include better JTA integration, etc?
>>
>> Cheers
>> Manik
>> --
>> Manik Surtani
>> manik at jboss.org
>> twitter.com/maniksurtani
>>
>> Lead, Infinispan
>> http://www.infinispan.org
>>
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
>
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev



More information about the infinispan-dev mailing list