<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><br>Sent from my iPhone</div><div><br>On 22 Jan 2014, at 13:58, Dan Berindei &lt;<a href="mailto:dan.berindei@gmail.com">dan.berindei@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 21, 2014 at 4:07 PM, Mircea Markus <span dir="ltr">&lt;<a href="mailto:mmarkus@redhat.com" target="_blank">mmarkus@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Emmanuel,<br>
<br>
Just had a good chat with Davide on this and one solution to overcome the shortcoming you mentioned in the above email would be to enhance the hotrod client to support grouping:<br>
<br>
RemoteClient.put(G g, K k, V v); //first param is the group<br>
RemoteClinet.getGroup(G g) : Map&lt;K,V&gt;;<br></blockquote><div><br></div><div>I think you'd also need RemoteClient.get(G g, K k), as in embedded mode the group is included in the key.<br></div></div></div></div></div></blockquote><div><br></div><div>Yes</div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<br>
It requires an enhancement on our local grouping API: EmbeddedCache.getGroup(G). This is something useful for us in a broader context, as it is the step needed to be able to deprecated AtomicMaps and get suggest them being replaced with Grouping.<br>

</blockquote><div><br></div><div>It would also require us to keep a Set&lt;K&gt; for each group, with the keys associated with that group. As such, I'm not sure it would be a lot easier to implement (correctly) than FineGrainedAtomicMap.<br>

<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
This approach still has some limitations compared to the current embedded integration:<br>
- performance caused by the lack of transactions: this means increased TCP chattiness between the Hot Rod client and the server.<br>
- you'd have to handle atomicity, potentially by retrying an operation<br>
<br>
What do you think?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Dec 3, 2013, at 3:10 AM, Mircea Markus &lt;<a href="mailto:mmarkus@redhat.com">mmarkus@redhat.com</a>&gt; wrote:<br>
<br>
&gt;<br>
&gt; On Nov 19, 2013, at 10:22 AM, Emmanuel Bernard &lt;<a href="mailto:emmanuel@hibernate.org">emmanuel@hibernate.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; It's an interesting approach that would work fine-ish for entities<br>
&gt;&gt; assuming the Hot Rod client is multi threaded and assuming the client<br>
&gt;&gt; uses Future to parallelize the calls.<br>
&gt;<br>
&gt; The Java Hotrod client is both multithreaded and exposes an Async API.<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; But it won't work for associations as we have them designed today.<br>
&gt;&gt; Each association - or more precisely the query results to go from an<br>
&gt;&gt; entity A1 to the list of entities B associated to it - is represented by<br>
&gt;&gt; an AtomicMap.<br>
&gt;&gt; Each entry in this map does correspond to an entry in the association.<br>
&gt;&gt;<br>
&gt;&gt; While we can "guess" the column names and build from the metadata the<br>
&gt;&gt; list of composed keys for entities, we cannot do the same for<br>
&gt;&gt; associations as the key is literally the (composite) id of the<br>
&gt;&gt; association and we cannot guess that most of the time (we can in very<br>
&gt;&gt; pathological cases).<br>
&gt;&gt; We could imagine that we list the association row keys in a special<br>
&gt;&gt; entry to work around that but this approach is just as problematic and<br>
&gt;&gt; is conceptually the same.<br>
&gt;&gt; The only solution would be to lock the whole association for each<br>
&gt;&gt; operation and I guess impose some versioning / optimistic lock.<br>
&gt;&gt;<br>
&gt;&gt; That is not a pattern that scales sufficiently from my experience.<br>
&gt;<br>
&gt; I think so too :-)<br>
&gt;<br>
&gt;&gt; That's the problem with interconnected data :)<br>
&gt;&gt;<br>
&gt;&gt; Emmanuel<br>
&gt;&gt;<br>
&gt;&gt; On Mon 2013-11-18 23:05, Mircea Markus wrote:<br>
&gt;&gt;&gt; Neither the grouping API nor the AtomicMap work over hotrod.<br>
&gt;&gt;&gt; Between the grouping API and AtomicMap, I think the one that would make more sense migrating is the grouping API.<br>
&gt;&gt;&gt; One way or the other, I think the hotrod protocol would require an enhancement - mind raising a JIRA for that?<br>
&gt;&gt;&gt; For now I guess you can sacrifice performance and always sending the entire object across on every update instead of only the deltas?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Nov 18, 2013, at 9:56 AM, Emmanuel Bernard &lt;<a href="mailto:emmanuel@hibernate.org">emmanuel@hibernate.org</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Someone mentioned the grouping API as some sort of alternative to<br>
&gt;&gt;&gt;&gt; AtomicMap. Maybe we should use that?<br>
&gt;&gt;&gt;&gt; Note that if we don't have a fine-grained approach we will need to<br>
&gt;&gt;&gt;&gt; make sure we *copy* the complex data structure upon reads to mimic<br>
&gt;&gt;&gt;&gt; proper transaction isolation.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Tue 2013-11-12 15:14, Sanne Grinovero wrote:<br>
&gt;&gt;&gt;&gt;&gt; On 12 November 2013 14:54, Emmanuel Bernard &lt;<a href="mailto:emmanuel@hibernate.org">emmanuel@hibernate.org</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt; On the transaction side, we can start without them.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; +1 on omitting transactions for now.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; And on the missing AtomicMaps, I hope the Infinispan will want to implement it?<br>
&gt;&gt;&gt;&gt;&gt; Would be good to eventually converge on similar featuresets on remote<br>
&gt;&gt;&gt;&gt;&gt; vs embedded APIs.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; I know the embedded version relies on batching/transactions, but I<br>
&gt;&gt;&gt;&gt;&gt; guess we could obtain a similar effect with some ad-hoc commands in<br>
&gt;&gt;&gt;&gt;&gt; Hot Rod?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Sanne<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; On Tue 2013-11-12 14:34, Davide D'Alto wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; I'm working on the integration between HotRod and OGM.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; We already have a dialect for Inifinispan and I'm trying to follow the same<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; logic.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; At the moment I'm having two problems:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; 1) In the Infinispan dialect we are using the AtomicMap and the<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; AtomicMapLookup but this classes don't work with the RemoteCache. Is there<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; an equivalent for HotRod?<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; 2) As far as I know HotRod does not support transactions. I've found a link<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; to a branch on Mircea repository:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://github.com/mmarkus/ops_over_hotrod/wiki/Usage-guide" target="_blank">https://github.com/mmarkus/ops_over_hotrod/wiki/Usage-guide</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Is this something I could/should use?<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Any help is appreciated.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thanks,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Davide<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Cheers,<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Mircea Markus<br>
&gt;&gt;&gt; Infinispan lead (<a href="http://www.infinispan.org" target="_blank">www.infinispan.org</a>)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<br>
&gt; Cheers,<br>
&gt; --<br>
&gt; Mircea Markus<br>
&gt; Infinispan lead (<a href="http://www.infinispan.org" target="_blank">www.infinispan.org</a>)<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
Cheers,<br>
--<br>
Mircea Markus<br>
Infinispan lead (<a href="http://www.infinispan.org" target="_blank">www.infinispan.org</a>)<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">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>
</div></div></blockquote></div><br></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>infinispan-dev mailing list</span><br><span><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></span></div></blockquote></body></html>