On Jul 10, 2013, at 3:49 PM, Dan Berindei <dan.berin...@gmail.com> wrote:

> 
> 
> 
> On Tue, Jul 9, 2013 at 12:48 PM, Mircea Markus <mmar...@redhat.com> wrote:
> 
> On 21 May 2013, at 17:09, Dan Berindei <dan.berin...@gmail.com> wrote:
> 
> > I wouldn't want to deprecate CCL, I think it definitely has a purpose - at 
> > least in invalidation mode.
> The only use case I'm aware of for invalidation is 2nd level cache and I 
> don't think that needs a remote cache, Galder wdyt?
> 
> I don't know if 2nd level cache actually uses ClusterCacheLoader, but it 
> could definitely use it without exposing the cache through HotRod.

Invalidation is indeed used by 2LC. It could be used by any application that 
uses Infinispan as a cache really.

ClusterCacheLoader is there to provide lazy-loading of data, either for 
invalidated or replicated caches. In the past, it was a good workaround if 
state transfer was slow.

Now, there's one situation where we definitely want to use ClusterCacheLoader 
with a replicated cache, and that's with the query cache [1]. The reason for 
that is that if you enable state transfer, it forces all replication calls to 
be synchronous (it used to be like this, not sure whether any more…), but in 
the query cache we want an asynchronous replicated cache, hence we use the CCL 
to retrieve data from other nodes.

[1] 
https://github.com/hibernate/hibernate-orm/blob/master/hibernate-infinispan/src/main/resources/org/hibernate/cache/infinispan/builder/infinispan-configs.xml#L108

> 
> >
> > Even in replication mode, having a lazy alternative to state transfer may 
> > be useful. Maybe not for the topology cache, but it might make sense for 
> > large caches.
> 
> this makes me wonder: what would be the case in which one doesn't want to use 
> state transfer for a distributed/replicated cache.

If the state is too big for a replicated cache, or if you want to have an 
asynchronous replicated cache.

> In replication mode, if the cache has a huge (non-shared) cache store, some 
> users may prefer to disable fetchPersistentState and rely on 
> ClusterCacheLoader instead for less frequently accessed keys.

I've never seen anyone use fetchPersistentState TBH. We brought it from JBoss 
Cache, but we should probably have ditched it.

> I don't know if it ever makes sense to use ClusterCacheLoader in distribution 
> mode, since it always sends the ClusteredGetCommand to the entire cluster.

CCL and distribution do not make sense. Distribution already queries other 
nodes for data.

> 
> 
> Cheers
> Dan
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


--
Galder Zamarreño
gal...@redhat.com
twitter.com/galderz

Project Lead, Escalante
http://escalante.io

Engineer, Infinispan
http://infinispan.org


_______________________________________________
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev

Reply via email to