<br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 13, 2017, 3:54 AM Radim Vansa &lt;<a href="mailto:rvansa@redhat.com">rvansa@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 06/12/2017 04:52 PM, William Burns wrote:<br>
&gt;<br>
&gt;<br>
&gt; On Sat, Jun 10, 2017 at 12:56 AM Radim Vansa &lt;<a href="mailto:rvansa@redhat.com" target="_blank">rvansa@redhat.com</a><br>
&gt; &lt;mailto:<a href="mailto:rvansa@redhat.com" target="_blank">rvansa@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Hi guys,<br>
&gt;<br>
&gt;     when the functional API has been outline, the interfaces were put into<br>
&gt;     infinispan-commons to make it possible to share these between remote<br>
&gt;     clients and embedded use case. However, it seems that reusing this<br>
&gt;     as-is<br>
&gt;     impossible or at least impractical as we cannot send the lambdas in a<br>
&gt;     language neutral way. In the future, we may implement a way to share<br>
&gt;     functions between client and a server but that will most likely result<br>
&gt;     in an interface accepting something else than Function&lt;ReadWriteEntry,<br>
&gt;     R&gt;. Also, it&#39;s rather weird to have two EntryVersion interfaces.<br>
&gt;<br>
&gt;     Therefore I suggest moving org.infinispan.commons.api.functional to<br>
&gt;     infinispan-core, package org.infinispan.api.functional<br>
&gt;<br>
&gt;     You might say that the server-side code would use the interfaces, but<br>
&gt;     once it&#39;s running on server, it should depend on core (or core-api) -<br>
&gt;     commons is what is shared with the client, and if the client will in<br>
&gt;     future register a new function on the server, the user code should<br>
&gt;     depend on core-api as well (client-hotrod itself does not have to).<br>
&gt;<br>
&gt;     If you wonder what led me to this is that I&#39;ve tried to add<br>
&gt;     SerializableFunction overloads to the FunctionalMap and found out that<br>
&gt;     SerializableFunction et all are only in infinispan-core (for good).<br>
&gt;<br>
&gt;<br>
&gt; We could move these into commons in a major version if we need to as<br>
&gt; well. I never thought about using them in the client code as we never<br>
&gt; planned on supporting serialized lambdas there, but if it makes other<br>
&gt; things easier I am for it.<br>
&gt;<br>
&gt; Also there is nothing stopping us from having these in commons right<br>
&gt; now, there is nothing special about the interfaces, they can just be<br>
&gt; copied over.<br>
<br>
-1 These can&#39;t be simply copied, because two modules cannot share a<br>
package name (org.infinispan.util), therefore we would have to move the<br>
SerializableFunction to org.infinispan.commons.util.function.</blockquote></div><div><br></div><div>I never said they had to be on the same package :-P</div><div><br></div><div class="gmail_quote"></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">But as you<br>
say; we can&#39;t/don&#39;t want to support lambdas in any remote client<br>
operations and therefore these would be superfluous in commons.</blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
We have to think about a pattern for the building-blocks (counters,<br>
locks, multimaps...): in embedded case we want to expose API using<br>
lambdas, in remote client this should be named filter, script or Ickle<br>
query. Obvious solution is having BaseFeature -&gt; EmbeddedFeature,<br>
RemoteFeature that would expose the functional operations symmetrically<br>
but with different API, but it seems to me a bit inelegant.<br></blockquote></div><div><br></div><div>This is always our problem, we never have a solution and then client API falls behind.</div><div><br></div><div>Also even though we wouldn&#39;t serialize lambdas with client, doesn&#39;t mean we can&#39;t use lambdas with the client. Just means the operation would have slower performance, since it would be evaluated in the client.</div><div><br></div><div>I personally welcome the BaseFeature you mentioned because we need that asap so that we can create these API while maintaining some type of semblance between them.</div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Note that embedded/remote building blocks will have different<br>
properties/behaviour anyway - e.g. for embedded it could be useful to<br>
execute an action once the &#39;owning node&#39; crashes (e.g. release a lock)<br>
while it does not make much sense with remote client.<br>
<br>
Radim<br>
<br>
&gt;<br>
&gt;     Please let me know if you have objections/if there something I<br>
&gt;     have missed.<br>
&gt;<br>
&gt;     Radim<br>
&gt;<br>
&gt;     --<br>
&gt;     Radim Vansa &lt;<a href="mailto:rvansa@redhat.com" target="_blank">rvansa@redhat.com</a> &lt;mailto:<a href="mailto:rvansa@redhat.com" target="_blank">rvansa@redhat.com</a>&gt;&gt;<br>
&gt;     JBoss Performance Team<br>
&gt;<br>
&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> &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt;     <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
<br>
<br>
--<br>
Radim Vansa &lt;<a href="mailto:rvansa@redhat.com" target="_blank">rvansa@redhat.com</a>&gt;<br>
JBoss Performance Team<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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</blockquote></div>