<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 4 Jul 2010, at 17:51, Israel Lacerra wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Using my strategy (create ReplicableCommand in CacheQueryImpl and then use RpcManager to broadcast the query), I'm having troubles getting the local Cache instance on each node. If I try to use CommandsFactory to initialize my replicableCommand, I create a undesired dependency: infinispan-core -&gt; infinispan-query.<br></blockquote><div><br></div><div>On the remote end, the Command is recreated using the following process:</div><div><br></div><div>1) &nbsp;The Marshaller framework is registered to use the&nbsp;ReplicableCommandExternalizer for all ReplicableCommands. &nbsp;This class has the knowledge of how to convert a stream of bytes to a ReplicableCommand on the remote end. &nbsp;ReplicableCommandExternalizer.readObject() will convert the stream into a command id + an array of object params.</div><div>2) &nbsp;ReplicableCommandExternalizer then passes this command id + params to&nbsp;RemoteCommandsFactory.fromStream(), which creates an *un-initialized* command, with params set (see javadocs on fromStream())</div><div>3) &nbsp;Before actually invoking the command, the InboundInvocationHandler *initializes* the command (injects the cache instance, component dependencies, etc) by calling&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;CommandsFactory.initializeReplicableCommand(). &nbsp;See&nbsp;InboundInvocationHandlerImpl.handle() for details.</div><div><br></div><div>HTH</div><div>Manik</div><div><br></div><br><blockquote type="cite">

<br>I need the Cache instance to get component registry and then get SearchFactoryImplementor to make the query.<br><br>Is there a way to get the local cache instance? <br><br>Someone has something to say about the way I'm solving it? Perhaps it's not the best way... <br>

<br><br>thanks!<br><br>Israel Lacerra<br>
<br><div class="gmail_quote">On Sat, Jun 19, 2010 at 9:31 PM, Israel Lacerra <span dir="ltr">&lt;<a href="mailto:israeldl@gmail.com" target="_blank">israeldl@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


Ok! Understood.<br><br>So I'll try to use RpcManager to broadcast the query.<br><br>Thanks!<br><font color="#888888">Israel</font><div><div></div><div><br><br><div class="gmail_quote">On Fri, Jun 18, 2010 at 6:42 PM, Manik Surtani <span dir="ltr">&lt;<a href="mailto:manik@jboss.org" target="_blank">manik@jboss.org</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><br>
On 9 Jun 2010, at 05:45, Israel Lacerra wrote:<br>
<br>
&gt; Manik,<br>
&gt;<br>
&gt; About the "map" part of the map/reduce of ISPN-200.<br>
&gt;<br>
&gt; Looking in the code, my intention is(briefly) create a ReplicableCommand in CacheQueryImpl and then use RpcManager to make the query on all nodes.<br>
&gt;<br>
&gt; But ISPN-200 depends on ISPN-39, right?<br>
<br>
</div>Well, not precisely. &nbsp;They are related and a degenerate case of ISPN-39 *could* work for you, but isn't necessary. &nbsp;Let me explain:<br>
<br>
ISPN-39 is about pushing tasks to nodes based on key. &nbsp;So, you may say something like, here's a task, T, which requires keys K1, K2, K3. &nbsp;The DistributionManager could then be used to determine the most appropriate node(s) to send T to, and process it there.<br>




<br>
Now in the case of ISPN-200, you don't know which nodes contain the entries you are looking for. &nbsp;So you would need to broadcast the task, T, which in this case is a query task, to *all* nodes. &nbsp;So while it is similar to ISPN-39 in that it executes remote tasks, the logic of determining which nodes to execute the task on is different - you would need to execute the task on all nodes all the time.<br>




<br>
Hope this clarifies things a bit. &nbsp;:)<br>
<br>
Cheers<br>
Manik<br>
<div><br>
&gt; This dependecy is about the map part? The idea behind ISPN-39 is to migrate a computation to other nodes? Like a "continuation"? And then ISPN-200 will use this api to make the query on all nodes?<br>
&gt;<br>
&gt;<br>
&gt; thanks!<br>
&gt;<br>
&gt; Israel<br>
&gt;<br>
&gt;<br>
</div>&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
<br>
--<br>
Manik Surtani<br>
<a href="mailto:manik@jboss.org" target="_blank">manik@jboss.org</a><br>
Lead, Infinispan<br>
Lead, JBoss Cache<br>
<a href="http://www.infinispan.org/" target="_blank">http://www.infinispan.org</a><br>
<a href="http://www.jbosscache.org/" target="_blank">http://www.jbosscache.org</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</blockquote></div><br>
</div></div></blockquote></div><br>
_______________________________________________<br>infinispan-dev mailing list<br><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/infinispan-dev</blockquote></div><br><div>
<span class="Apple-style-span" style="font-size: 12px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div>Lead, Infinispan</div><div>Lead, JBoss Cache</div><div><a href="http://www.infinispan.org">http://www.infinispan.org</a></div><div><a href="http://www.jbosscache.org">http://www.jbosscache.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br></body></html>