<div dir="ltr">Thanks for the explanation Tristan! Great example!<div><br></div><div>Following our discussion on IRC - would it make sense to make this refactoring a bit broader and take Marshallers/Filter/Converters into consideration (we don&#39;t need to implement everything in a single step... just get the big pictures how all those pieces combine together)?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 26, 2016 at 9:17 AM, Tristan Tarrant <span dir="ltr">&lt;<a href="mailto:ttarrant@redhat.com" target="_blank">ttarrant@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">So let&#39;s see what an implementation of #4 would entail:<br>
<br>
<br>
A mini-subsystem per cache-store which can parse the following:<br>
<br>
&lt;subsystem xmlns=&quot;urn:infinispan:server:cachestore:cassandra:8.2&quot;&gt;<br>
   &lt;cassandra-store name=&quot;mycassandrastore&quot;<br>
                    auto-create-keyspace=&quot;true&quot; keyspace=&quot;TestKeyspace&quot;<br>
                    entry-table=&quot;TestEntryTable&quot;<br>
                    consistency-level=&quot;LOCAL_ONE&quot;<br>
                    serial-consistency-level=&quot;SERIAL&quot;&gt;<br>
     &lt;cassandra-server host=&quot;127.0.0.1&quot; port=&quot;9042&quot; /&gt;<br>
     &lt;cassandra-server host=&quot;127.0.0.1&quot; port=&quot;9041&quot; /&gt;<br>
     &lt;connection-pool heartbeat-interval-seconds=&quot;30&quot;<br>
                      idle-timeout-seconds=&quot;120&quot;<br>
                      pool-timeout-millis=&quot;5&quot; /&gt;<br>
   &lt;/cassandra-store&gt;<br>
&lt;/subsystem&gt;<br>
<br>
The subsystem would be responsible for parsing the configuration and<br>
registering an appropriate StoreConfigurationBuilder under a named<br>
Service within the server. We need to be careful about class loader<br>
visibility, but the datasource subsystem does something similar, so it<br>
should be possible.<br>
<br>
The main Infinispan subsystem would need to be extended to be able to<br>
parse the following (simplified):<br>
<br>
&lt;subsystem xmlns=&quot;urn:infinispan:server:core:8.2&quot;&gt;<br>
   &lt;cache-container name=&quot;clustered&quot;&gt;<br>
     &lt;distributed-cache name=&quot;default&quot;&gt;<br>
       &lt;store ref=&quot;infinispan/cachestore/cassandra/mycassandrastore&quot;<br>
              passivation=&quot;true&quot; fetch-state=&quot;true&quot; preload=&quot;true&quot;<br>
              purge=&quot;false&quot; /&gt;<br>
     &lt;/distributed-cache&gt;<br>
   &lt;/cache-container&gt;<br>
&lt;/subsystem&gt;<br>
<br>
It would also not be difficult, for symmetry, to support a compatible<br>
schema for the embedded use-case.<br>
<br>
The cachestores would be distributed both as a simple jar for embedded<br>
use-cases and as a zip containing the necessary modules for server.<br>
Note that this would not leverage the deployable cachestores machinery<br>
as subsystems need to be installed as modules.<br>
<br>
Tristan<br>
<span class=""><br>
<br>
On 25/01/2016 16:01, Sebastian Laskawiec wrote:<br>
&gt; Is it possible to have #3 and use a dedicated configuration schema per<br>
&gt; Cache Store? Otherwise the only way to configure a Cache Store it to use<br>
&gt; properties (key/value pairs).<br>
&gt;<br>
&gt; If it&#39;s not possible to have a custom configuration schema - I would<br>
&gt; vote for #4.<br>
&gt;<br>
&gt; On Mon, Jan 25, 2016 at 3:42 PM, Tristan Tarrant &lt;<a href="mailto:ttarrant@redhat.com">ttarrant@redhat.com</a><br>
</span><div><div class="h5">&gt; &lt;mailto:<a href="mailto:ttarrant@redhat.com">ttarrant@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Yes, that would be nice.<br>
&gt;<br>
&gt;     I found another &quot;cons&quot; for #4: an embedded config would not translate<br>
&gt;     1:1 to server. Well, it doesn&#39;t translate directly now either, but at<br>
&gt;     least it&#39;s &quot;closer&quot;.<br>
&gt;<br>
&gt;     Tristan<br>
&gt;<br>
&gt;     On 25/01/2016 15:39, Radim Vansa wrote:<br>
&gt;      &gt; Would the deployable cache stores benefit from 4) as well? It<br>
&gt;     seems to<br>
&gt;      &gt; me as the only &#39;right&#39; option.<br>
&gt;      &gt;<br>
&gt;      &gt; R.<br>
&gt;      &gt;<br>
&gt;      &gt; On 01/25/2016 02:29 PM, Tristan Tarrant wrote:<br>
&gt;      &gt;&gt; Hi all,<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; Jakub has recently revived the Cassandra Cache Store (CCS from<br>
&gt;     now on)<br>
&gt;      &gt;&gt; which, as you all will remember, was pushed to an external<br>
&gt;     repository<br>
&gt;      &gt;&gt; where it lay in abandonment ever since.<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; We now need to add support for this store to Infinispan Server, but<br>
&gt;      &gt;&gt; unfortunately, because of the &quot;monolithic schema&quot; approach that<br>
&gt;     WildFly<br>
&gt;      &gt;&gt; imposes on subsystems, this has to be done within the Infinispan<br>
&gt;      &gt;&gt; subsystem itself.<br>
&gt;      &gt;&gt; This creates a conundrum, since the CCS depends on Infinispan core,<br>
&gt;      &gt;&gt; server would depend on the CCS but server is part of the<br>
&gt;     Infinispan build.<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; Possible solutions:<br>
&gt;      &gt;&gt; 1) move the CCS back into the main repo<br>
&gt;      &gt;&gt;       - pros: no more conundrum, built by default, easier to<br>
&gt;     maintain<br>
&gt;      &gt;&gt;       - cons: makes the repo even bigger, binds the lifecycle of<br>
&gt;     the CCS<br>
&gt;      &gt;&gt; to Infinispan&#39;s<br>
&gt;      &gt;&gt; 2) extend the server to be able to interpret the CCS schema but not<br>
&gt;      &gt;&gt; actually depend on its code and provide the code to instantiate<br>
&gt;     the CCS<br>
&gt;      &gt;&gt; as an overlay module which can be installed on server<br>
&gt;      &gt;&gt;       - pros: keeps the lifecycle of the CCS independent<br>
&gt;      &gt;&gt;       - cons: additional complexity to handle the split, forces<br>
&gt;     us to<br>
&gt;      &gt;&gt; still keep server aligned with schema changes in the CCS itself.<br>
&gt;      &gt;&gt; 3) make the CCS a deployable cache store<br>
&gt;      &gt;&gt;       - pros: easiest<br>
&gt;      &gt;&gt;       - cons: not really ootb experience, no nice schema<br>
&gt;      &gt;&gt; 4) create a dedicated subsystem for the CCS and &quot;invent&quot; a way to<br>
&gt;      &gt;&gt; reference it from the main Infinispan subsystem using a naming<br>
&gt;      &gt;&gt; convention, similar to how datasources are currently implemented.<br>
&gt;      &gt;&gt;       - pros: keeps the two projects independent, reusable for other<br>
&gt;      &gt;&gt; Cachestores<br>
&gt;      &gt;&gt;       - cons: writing a subsystem from scratch is complex<br>
&gt;     (although bits<br>
&gt;      &gt;&gt; of it could be made reusable for multiple cachestores).<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; Your thoughts please.<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; Tristan<br>
&gt;      &gt;<br>
&gt;      &gt;<br>
&gt;<br>
&gt;     --<br>
&gt;     Tristan Tarrant<br>
&gt;     Infinispan Lead<br>
&gt;     JBoss, a division of Red Hat<br>
&gt;     _______________________________________________<br>
&gt;     infinispan-dev mailing list<br>
</div></div>&gt;     <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org">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>
<div class="HOEnZb"><div class="h5">&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org">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>
&gt;<br>
<br>
--<br>
Tristan Tarrant<br>
Infinispan Lead<br>
JBoss, a division of Red Hat<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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</div></div></blockquote></div><br></div>