<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>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><br></div><div>Cheers</div><div><br></div><div>Katia<br><br>[1] <a href="https://github.com/vert-x3/vertx-infinispan">https://github.com/vert-x3/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">https://github.com/vert-x3/vertx-infinispan/blob/master/src/main/java/io/vertx/ext/cluster/infinispan/impl/InfinispanAsyncMultiMap.java</a><br><br>[3] <a href="https://gist.github.com/karesti/194bb998856d4a2828d83754130ed79c">https://gist.github.com/karesti/194bb998856d4a2828d83754130ed79c</a><div><div><div><span style="color:rgb(0,0,0);font-family:menlo;font-size:9pt"></span> </div></div></div></div></div></div>