<div dir="ltr">Hi Katia,<br><div class="gmail_extra"><br><div class="gmail_quote">2017-04-04 16:44 GMT+02:00 Katia Aresti <span dir="ltr">&lt;<a href="mailto:karesti@redhat.com" target="_blank">karesti@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>As you probably know, Will and I are working on the vert-x infinispan integration [1], where the primary goal is to make infinispan the default cluster management of vert-x. (yeah!)</div></div></blockquote><div><br></div><div>This can&#39;t be the primary goal. Making it the best cluster manager would be great though!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Vert-x needs support for an Async Multimap. Today&#39;s implementation is a wrapper on a normal Cache where only Cache Key&#39;s are used to implement the multi map [2].</div><div>This is not very efficient, so after trying some other alternative implementations [3] that don&#39;t fully work (injection not working), Will and I have come to the conclusion that it might be a good idea to start having our own native CacheMultimap. This first multimap won&#39;t support duplicate values on key&#39;s.</div><div><br></div><div>As a quick start, the smallest multimap we need should implement the following interface :<br></div><div><pre style="color:rgb(0,0,0);font-family:menlo;font-size:9pt"><span style="color:rgb(0,0,128);font-weight:bold">public interface </span>CacheMultimap&lt;<span style="color:rgb(32,153,157)">K</span>, <span style="color:rgb(32,153,157)">V</span>&gt; {<br>   <span style="color:rgb(32,153,157)">V </span>put(<span style="color:rgb(32,153,157)">K </span>key, <span style="color:rgb(32,153,157)">V </span>value);<br><br>   Collection&lt;<span style="color:rgb(32,153,157)">V</span>&gt; get(<span style="color:rgb(32,153,157)">K </span>key);<br><br>   <span style="color:rgb(0,0,128);font-weight:bold">boolean </span>remove(<span style="color:rgb(32,153,157)">K </span>key, <span style="color:rgb(32,153,157)">V </span>value);<br>}</pre><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">CacheMultimapImpl</span> will be a wrapper on a normal Cache, similar to [3].</div><div><br></div><div>We could add a new method in <span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">EmbeddedCacheManager.java</span></div><div><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt"><br></span></div><div><span style="background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">&lt;</span><span style="font-family:menlo;font-size:9pt;color:rgb(32,153,157)">K</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">, </span><span style="font-family:menlo;font-size:9pt;color:rgb(32,153,157)">V</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">&gt; </span><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">CacheMultimap</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">&lt;</span><span style="font-family:menlo;font-size:9pt;color:rgb(32,153,157)">K</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">, </span><span style="font-family:menlo;font-size:9pt;color:rgb(32,153,157)">V</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">&gt; </span><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">getCacheMultimap</span><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">(String cacheName, </span><span style="font-family:menlo;font-size:9pt;color:rgb(0,0,128);font-weight:bold">boolean </span><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt">createIfAbsent);</span><br></span></div><div><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt"><br></span></div>Implementation will create a cache as always and return a new CacheMultimapImpl(cache). <div><br></div><div>What do you think ? Please fell free to suggest any other alternative or idea.</div></div></blockquote><div><br></div><div>One thing we need in vertx-infinispan is the ability to clean the multimap, meaning removing some key/value pairs if value matches criteria.</div><div><br></div><div>It doesn&#39;t seem possible with this interface. At least, it misses a method to get all the keys from this multimap. Ideally, I would like to be able to supply a Serializable Predicate.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><br></div><div>Cheers</div><div><br></div><div>Katia<br></div></div></div></blockquote><div><br></div><div><br></div><div>Thank you for looking into this!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><br>[1] <a href="https://github.com/vert-x3/vertx-infinispan" target="_blank">https://github.com/vert-x3/<wbr>vertx-infinispan</a><br><br>[2] <a href="https://github.com/vert-x3/vertx-infinispan/blob/master/src/main/java/io/vertx/ext/cluster/infinispan/impl/InfinispanAsyncMultiMap.java" target="_blank">https://github.com/vert-x3/<wbr>vertx-infinispan/blob/master/<wbr>src/main/java/io/vertx/ext/<wbr>cluster/infinispan/impl/<wbr>InfinispanAsyncMultiMap.java</a><br><br>[3] <a href="https://gist.github.com/karesti/194bb998856d4a2828d83754130ed79c" target="_blank">https://gist.github.com/<wbr>karesti/<wbr>194bb998856d4a2828d83754130ed7<wbr>9c</a><div><div><div><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt"></span> </div></div></div></div></div></div>
<br>______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/infinispan-<wbr>dev</a><br></blockquote></div><br></div></div>