<div dir="ltr"><div style><span style="font-family:arial,sans-serif;font-size:13px">&gt;Would the L1 data container be a &quot;separate, but equal&quot; container?  i.e.</span><br></div><span style="font-family:arial,sans-serif;font-size:13px">&gt;</span><span style="font-family:arial,sans-serif;font-size:13px">would it be  a separate instance from the DIST_SYNC cache but the exact same</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">&gt;</span><span style="font-family:arial,sans-serif;font-size:13px">data structure?</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">&gt;</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">&gt;</span><span style="font-family:arial,sans-serif;font-size:13px">or</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">&gt;</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">&gt;</span><span style="font-family:arial,sans-serif;font-size:13px">Would the L1 data container be &quot;separate, and different&quot; container?  i.e.</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">&gt;</span><span style="font-family:arial,sans-serif;font-size:13px">would it be a completely different data structure (and API) from the</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">&gt;</span><span style="font-family:arial,sans-serif;font-size:13px">DIST_SYNC cache?</span><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Currently it would be using the same implementation and interface behind the scenes.  My initial thought is that it would always use the same interface, but we could add a specific implementation later if we found additional optimizations.<br>
</font><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 19, 2013 at 9:34 AM, Pedro Ruivo <span dir="ltr">&lt;<a href="mailto:pedro@infinispan.org" target="_blank">pedro@infinispan.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi<br>
<br>
+1 :)<br>
<br>
some comments inline.<br>
<br>
Pedro<br>
<div class="im"><br>
On 06/19/2013 02:16 PM, Manik Surtani wrote:<br>
&gt; I have often thought of this.  Comments inline:<br>
&gt;<br>
&gt; On 19 Jun 2013, at 13:44, William Burns &lt;<a href="mailto:mudokonman@gmail.com">mudokonman@gmail.com</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:mudokonman@gmail.com">mudokonman@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;&gt; All the L1 data for a DIST cache is stored in the same data container<br>
&gt;&gt; as the actual distributed data itself.  I wanted to propose breaking<br>
&gt;&gt; this out so there is a separate data container for the L1 cache as<br>
&gt;&gt; compared to the distributed data.<br>
&gt;&gt;<br>
&gt;&gt; I thought of a few quick benefits/drawbacks:<br>
&gt;&gt;<br>
&gt;&gt; Benefits:<br>
&gt;&gt; 1. L1 cache can be separately tuned - L1 maxEntries for example<br>
<br>
</div>+1 for the maxEntries. I think the L1 should be always bounded to avoid<br>
any memory issues<br></blockquote><div style>+1 always having it be bounded would be really good.  The configuration could have a default and there could be a check to make sure they have &gt; 1 configured if provided.  I don&#39;t know what would be the best default here though? 64? 128? 1024?</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im"><br>
&gt;&gt; 2. L1 values will not cause eviction of real data<br>
&gt;&gt; 3. Would make <a href="https://issues.jboss.org/browse/ISPN-3229" target="_blank">https://issues.jboss.org/browse/ISPN-3229</a> an easy fix<br>
&gt;&gt; 4. Could add a new DataContainer implementation specific to L1 with<br>
&gt;&gt; additional optimizations<br>
&gt;&gt; 5. Help with some concurrency issues with L1 without requiring wider<br>
&gt;&gt; locking (such as locking a key for an entire ClusteredGet rpc call) -<br>
&gt;&gt; <a href="https://issues.jboss.org/browse/ISPN-3197" target="_blank">https://issues.jboss.org/browse/ISPN-3197</a>.<br>
&gt;&gt;<br>
&gt;&gt; Drawbacks:<br>
&gt;&gt; 1. Would require, depending on configuration, an additional thread for<br>
&gt;&gt; eviction<br>
&gt;<br>
&gt; Not really - the same eviction thread used for the main data container<br>
&gt; could also clean things up in the L1 DC.<br></div></blockquote><div style>+1</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">
&gt;<br>
&gt;&gt; 2. Users upgrading could have double memory used up due to 2 data<br>
&gt;&gt; containers<br>
&gt;<br>
&gt; This is just a fixed (and small) overhead.  Not actually double the<br>
&gt; memory used by the entire grid.<br>
<br>
</div>agree.<br>
<div class="im"><br>
&gt;<br>
&gt; Additional drawbacks:<br>
&gt; - More complex lookups in the DC.  Code that would otherwise just call<br>
&gt; DC.get() would now need to also check L1DC.  This would be scattered all<br>
&gt; over the code-base - unless perhaps the main DC would implicitly also<br>
&gt; check the contents of the L1DC (if one is available).<br>
<br>
</div>I don&#39;t think so. We should only query the L1DC just before performing<br>
the remote get. This way, only the DistributionInterceptor (and<br>
sub-classes) will keep a reference to L1DC to query, store, etc.<br></blockquote><div>That was my thought as well that the L1 interceptor would automatically put the L1 cached value in the context, which is simple for non Tx.  Tx is a little muddier, but would be more clear when <a href="https://issues.jboss.org/browse/ISPN-1540">https://issues.jboss.org/browse/ISPN-1540</a> is added as well.</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
possible advantages:<br>
<br>
* use it own lock manager<br>
* try reduce some network traffic by keep tracking the remote gets and<br>
if the key requested does not exist in the L1DC but another thread<br>
already made the remote get, it could skip a second remote get... this<br>
could be discussed later...<br></blockquote><div style>Yeah I already have a prototype for this where requests for gets on the same key would wait for the first to finish and would be done in a way that wouldn&#39;t also block writes. </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im"><br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Both?:<br>
&gt;&gt; 1. Additional configuration available<br>
&gt;&gt;    a. Add maxEntires just like the normal data container (use data<br>
&gt;&gt; container size if not configured?)<br>
&gt;&gt;    b. Eviction wakeup timer?  We could just reuse the task cleanup<br>
&gt;&gt; frequency?<br>
&gt;&gt;    c. Eviction strategy?  I would think the default data container&#39;s<br>
&gt;&gt; would be sufficient.<br>
<br>
</div>for the beginning the current data container should work fine. But in<br>
the future, if we found that some parts can be optimized for the L1 uses<br>
cases, I think an optimized DC would be better.<br></blockquote><div style>My thought as well (Benefit #4) </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="im">&gt;&gt;<br>
&gt;&gt; I was wondering what you guys thought.<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt;<br>
&gt;&gt;  - Will<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; infinispan-dev mailing list<br>
</div>&gt;&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>
<div class="im">&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; --<br>
&gt; Manik Surtani<br>
</div>&gt; <a href="mailto:manik@jboss.org">manik@jboss.org</a> &lt;mailto:<a href="mailto:manik@jboss.org">manik@jboss.org</a>&gt;<br>
&gt; <a href="http://twitter.com/maniksurtani" target="_blank">twitter.com/maniksurtani</a> &lt;<a href="http://twitter.com/maniksurtani" target="_blank">http://twitter.com/maniksurtani</a>&gt;<br>
<div class="im">&gt;<br>
&gt; Platform Architect, JBoss Data Grid<br>
&gt; <a href="http://red.ht/data-grid" target="_blank">http://red.ht/data-grid</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
</div><div class=""><div class="h5">&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" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<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>