<div dir="ltr">Since I have had some time to think it over I like Pedro&#39;s layout, unless someone has a strong objection.<br><br>Responses inline.<br><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 31, 2016 at 4:51 AM Radim Vansa &lt;<a href="mailto:rvansa@redhat.com">rvansa@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10/27/2016 05:26 PM, William Burns wrote:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; On Thu, Oct 27, 2016 at 9:56 AM Pedro Ruivo &lt;<a href="mailto:pedro@infinispan.org" class="gmail_msg" target="_blank">pedro@infinispan.org</a><br class="gmail_msg">
&gt; &lt;mailto:<a href="mailto:pedro@infinispan.org" class="gmail_msg" target="_blank">pedro@infinispan.org</a>&gt;&gt; wrote:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;     On 27-10-2016 14:20, William Burns wrote:<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; On Thu, Oct 27, 2016 at 4:56 AM Pedro Ruivo<br class="gmail_msg">
&gt;     &lt;<a href="mailto:pedro@infinispan.org" class="gmail_msg" target="_blank">pedro@infinispan.org</a> &lt;mailto:<a href="mailto:pedro@infinispan.org" class="gmail_msg" target="_blank">pedro@infinispan.org</a>&gt;<br class="gmail_msg">
&gt;     &gt; &lt;mailto:<a href="mailto:pedro@infinispan.org" class="gmail_msg" target="_blank">pedro@infinispan.org</a> &lt;mailto:<a href="mailto:pedro@infinispan.org" class="gmail_msg" target="_blank">pedro@infinispan.org</a>&gt;&gt;&gt; wrote:<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     On 26-10-2016 23:06, William Burns wrote:<br class="gmail_msg">
&gt;     &gt;     &gt; I have been working on adding in off heap support for a given<br class="gmail_msg">
&gt;     &gt;     cache.  I<br class="gmail_msg">
&gt;     &gt;     &gt; wanted to check in and let you all know what I was<br class="gmail_msg">
&gt;     thinking for the<br class="gmail_msg">
&gt;     &gt;     &gt; configuration and changes that would come about with it.<br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt; TLDR;<br class="gmail_msg">
&gt;     &gt;     &gt; New config under data container to enable off heap,<br class="gmail_msg">
&gt;     StoreAsBinary<br class="gmail_msg">
&gt;     &gt;     &gt; removed, Equivalence removed<br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt; First I was planning on adding new sub elements of data<br class="gmail_msg">
&gt;     container.<br class="gmail_msg">
&gt;     &gt;     &gt; These would be instance, binary and off-heap. Only of the<br class="gmail_msg">
&gt;     three could<br class="gmail_msg">
&gt;     &gt;     &gt; be picked as they are mutually exclusive. Instance is as we<br class="gmail_msg">
&gt;     &gt;     operate now<br class="gmail_msg">
&gt;     &gt;     &gt; where we store the instance of the object passed to us.<br class="gmail_msg">
&gt;     Binary is<br class="gmail_msg">
&gt;     &gt;     &gt; essentially what we have now that is called storeAsBinary with<br class="gmail_msg">
&gt;     &gt;     both keys<br class="gmail_msg">
&gt;     &gt;     &gt; and values converted.  Lastly off-heap would store the<br class="gmail_msg">
&gt;     entry as a<br class="gmail_msg">
&gt;     &gt;     byte[]<br class="gmail_msg">
&gt;     &gt;     &gt; store completely in native memory.<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     I prefer &#39;object&#39; instead of &#39;instance&#39;.<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; Sounds fine with me.<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     Are you also planning to remove the expiration and/or eviction<br class="gmail_msg">
&gt;     &gt;     configuration elements and set them in the data-container<br class="gmail_msg">
&gt;     sub elements?<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; I wasn&#39;t planning on touching those.  But now that you mention it,<br class="gmail_msg">
&gt;     &gt; eviction only makes sense in the data container, where as<br class="gmail_msg">
&gt;     expiration is<br class="gmail_msg">
&gt;     &gt; container and cache store.  And taking this further storeAsBinary is<br class="gmail_msg">
&gt;     &gt; both as well, only off-heap is container only.  I wonder if<br class="gmail_msg">
&gt;     instead we<br class="gmail_msg">
&gt;     &gt; should have a separate storage element at the same level as<br class="gmail_msg">
&gt;     &gt; data-container.  I can see it either way.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;     Let me know if this makes sense:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;     &lt;expiration&gt; //no changes here<br class="gmail_msg">
&gt;     &lt;memory evictionStrategy=... evictionPolicy=...&gt; <br></blockquote><div><br></div><div>There wouldn&#39;t be any elements here.  The strategy would always be TinyLFU as this is all Caffeine supports.  The thread policy though is interesting, I would say for now don&#39;t let it be configured and it will run in the same thead.  However Caffeine does have async eviction which we could utilize in the future.  But I think we can look into that later and not part of this.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&gt;<br class="gmail_msg">
&gt;     //one of the following<br class="gmail_msg">
&gt;          &lt;on-heap max-entries=.../&gt;<br class="gmail_msg">
&gt;          &lt;on-heap-binary max-size=.../&gt;<br class="gmail_msg">
&gt;          &lt;off-heap ...max-size? and off-heap config.../&gt;<br class="gmail_msg"></blockquote><div><br></div><div>I think I like the naming of the elements as OBJECT, BINARY and OFF-HEAP/NATIVE that Radim mentioned.<br><br></div><div>I am thinking for now OBJECT would only support max-entries and the other 2 could support both max-entries or max-size.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&gt;<br class="gmail_msg">
&gt;     &lt;/memory&gt;<br class="gmail_msg">
&gt;     &lt;persistence&gt; //no changes here<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;     wdyt?<br class="gmail_msg">
&gt;<br class="gmail_msg">
<br class="gmail_msg">
While I prefer &quot;on-heap&quot; instead of &quot;object&quot; or &quot;instance&quot;, I don&#39;t<br class="gmail_msg">
think that &quot;binary&quot; should be its own element. Are there any attributes<br class="gmail_msg">
specific to that (do you plan to have keys=&quot;false&quot; values=&quot;true&quot;? I<br class="gmail_msg">
guess not). &quot;on-heap&quot; and &quot;off-heap&quot; is a binary ( :-) ) option,<br class="gmail_msg">
&quot;on-heap-binary&quot; is just a flavour of &quot;on-heap&quot;.<br class="gmail_msg"></blockquote><div><br></div><div>Right now the plan is to remove keys and values and always do both.  But we may have to change that later, I don&#39;t know.  Having separate elements gives us more flexibility which I like.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
For comparison, HC uses<br class="gmail_msg">
&lt;in-memory-format&gt;OBJECT|BINARY|NATIVE&lt;/in-memory-format&gt; where &quot;NATIVE&quot;<br class="gmail_msg">
means off-heap. I like &quot;format= OBJECT|BINARY&quot; as a child of on-heap,<br class="gmail_msg">
either as attribute or element. I haven&#39;t found similar settings in<br class="gmail_msg">
Coherence - seems that they store data in a serialized form only when<br class="gmail_msg">
they persist to disk/flash or offload to non-managed memory.<br class="gmail_msg"></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
Regarding Equivalence: can&#39;t we wrap objects in a similar way we do with<br class="gmail_msg">
byte[] if Equivalance (different from AnyInstance) is defined? I can<br class="gmail_msg">
definitely see use case when the hashCode() is not very well defined and<br class="gmail_msg">
user can&#39;t change the class - he has to wrap the objects themselves.<br class="gmail_msg"></blockquote><div><br></div><div>Hrmm we could add that back in if it is really needed.  As far as I know though no one has really used this.  I would rather make it more minimalistic to begin with and add back on as we find we need features.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
R.<br class="gmail_msg">
<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Seems fine to me.  And to be honest I forgot to mention this but<br class="gmail_msg">
&gt; EvictionStrategy and EvictionPolicy are completely redundant now.<br class="gmail_msg">
&gt; Policy has been for a while as we always used the same thread and<br class="gmail_msg">
&gt; Strategy is only Caffeine and for off heap I was thinking of a simple LRU.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; This means that the data container element would be removed in favor<br class="gmail_msg">
&gt; of &quot;memory&quot;?  The reason being is that equivalence will be gone and<br class="gmail_msg">
&gt; afaik we never really supported a custom data container (eviction<br class="gmail_msg">
&gt; wouldn&#39;t work with it and neither would off heap).  In that case why<br class="gmail_msg">
&gt; not just keep using data container element?<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt; Example:<br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt;  &lt;data-container&gt;<br class="gmail_msg">
&gt;     &gt;     &gt;    &lt;off-heap/&gt;<br class="gmail_msg">
&gt;     &gt;     &gt;   &lt;/data-container&gt;<br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt; The reason it is a subelement instead of a property is because<br class="gmail_msg">
&gt;     &gt;     off-heap<br class="gmail_msg">
&gt;     &gt;     &gt; will most likely require some additional configuration to<br class="gmail_msg">
&gt;     tell how<br class="gmail_msg">
&gt;     &gt;     many<br class="gmail_msg">
&gt;     &gt;     &gt; entries to store in the a bucket (think non resizing HashMap).<br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt; With these changes storeAsBinary becomes redundant, so I was<br class="gmail_msg">
&gt;     &gt;     planning on<br class="gmail_msg">
&gt;     &gt;     &gt; removing this configuration completely.  I would rather<br class="gmail_msg">
&gt;     remove since<br class="gmail_msg">
&gt;     &gt;     &gt; this is 9.0 and not deprecate.  As far as I know nobody<br class="gmail_msg">
&gt;     really used it<br class="gmail_msg">
&gt;     &gt;     &gt; before.<br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt; Also another side effect is I was removing all of the<br class="gmail_msg">
&gt;     Equivalence<br class="gmail_msg">
&gt;     &gt;     &gt; classes.  I am not sure if I can plainly remove them since<br class="gmail_msg">
&gt;     they have<br class="gmail_msg">
&gt;     &gt;     &gt; lived in commons for quite a while, but it would be best<br class="gmail_msg">
&gt;     if I could,<br class="gmail_msg">
&gt;     &gt;     &gt; although I am fine deprecating.  In its place the instance<br class="gmail_msg">
&gt;     setting for<br class="gmail_msg">
&gt;     &gt;     &gt; data-container will always wrap byte[] to satisfy equals<br class="gmail_msg">
&gt;     and hashCode<br class="gmail_msg">
&gt;     &gt;     &gt; methods.<br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt; Any feedback would be appreciated.<br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt; Thanks,<br class="gmail_msg">
&gt;     &gt;     &gt;  - Will<br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     &gt; _______________________________________________<br class="gmail_msg">
&gt;     &gt;     &gt; infinispan-dev mailing list<br class="gmail_msg">
&gt;     &gt;     &gt; <a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;<br class="gmail_msg">
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;&gt;<br class="gmail_msg">
&gt;     &gt;     &gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br class="gmail_msg">
&gt;     &gt;     &gt;<br class="gmail_msg">
&gt;     &gt;     _______________________________________________<br class="gmail_msg">
&gt;     &gt;     infinispan-dev mailing list<br class="gmail_msg">
&gt;     &gt; <a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;<br class="gmail_msg">
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;&gt;<br class="gmail_msg">
&gt;     &gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; _______________________________________________<br class="gmail_msg">
&gt;     &gt; infinispan-dev mailing list<br class="gmail_msg">
&gt;     &gt; <a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;<br class="gmail_msg">
&gt;     &gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     _______________________________________________<br class="gmail_msg">
&gt;     infinispan-dev mailing list<br class="gmail_msg">
&gt;     <a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;<br class="gmail_msg">
&gt;     <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; _______________________________________________<br class="gmail_msg">
&gt; infinispan-dev mailing list<br class="gmail_msg">
&gt; <a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Radim Vansa &lt;<a href="mailto:rvansa@redhat.com" class="gmail_msg" target="_blank">rvansa@redhat.com</a>&gt;<br class="gmail_msg">
JBoss Performance Team<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
infinispan-dev mailing list<br class="gmail_msg">
<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br class="gmail_msg">
</blockquote></div></div></div>