Manik and I agreed on API we need in DistributedCallable:

Map<String, Set<K>> getRelatedKeys(); 
void mappedToNode(CacheManager cm);

I will update the document accordingly. 


On 2010-08-02, at 10:36, Manik Surtani <manik@jboss.org> wrote:

Simple: the environment first calls getRelatedKeys(), and the impl passes back the keys it would need.  The env then maps the task to a node, based on locating the keys, serializes and pushes the callable to the assigned node.  The assigned node then calls mappedToNode() so that the impl has a ref to the cache in the local VM.  After that, call() is invoked.

On 2 Aug 2010, at 15:31, vblagoje@redhat.com wrote:

I would love to make it this simple but how does execution environment know which cache to pass in mappedToNode? Task Implementors somehow have to inform the environment about the cache they need to retrieve data....   



I still don't see why you need to pass it the cache manager.  Perhaps:

DistributedCallable {

Set<K> getRelatedKeys();

void mappedToNode(Cache<K, V> cache);

}


--
Manik Surtani
manik@jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org





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

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

--
Manik Surtani
manik@jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org





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