Alright seems fine to me.<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Mar 1, 2017, 9:27 AM Tristan Tarrant <<a href="mailto:ttarrant@redhat.com">ttarrant@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 01/03/17 13:01, Dan Berindei wrote:<br class="gmail_msg">
> On Wed, Mar 1, 2017 at 10:18 AM, Radim Vansa <<a href="mailto:rvansa@redhat.com" class="gmail_msg" target="_blank">rvansa@redhat.com</a>> wrote:<br class="gmail_msg">
>> I still think that if the cache is already defined, defineConfiguration<br class="gmail_msg">
>> should throw an exception. This javadoc was written 7 years ago [1],<br class="gmail_msg">
<br class="gmail_msg">
> I agree with throwing an exception in defineConfiguration(...) when<br class="gmail_msg">
> that cache is already defined.<br class="gmail_msg">
<br class="gmail_msg">
+1<br class="gmail_msg"></blockquote></div><div><br></div><div>I get a lot of tests to change and remove now 😁</div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
> getCache(cache, configurationName) when the cache is already defined,<br class="gmail_msg">
> I'd just ignore the new configuration (as we already ignore it when<br class="gmail_msg">
> the cache is runninng) and maybe log a warning telling people to use<br class="gmail_msg">
> defineConfiguration(cacheName, configurationName, new<br class="gmail_msg">
> ConfigurationBuilder().build()) + getCache(cacheName).<br class="gmail_msg">
<br class="gmail_msg">
+1<br class="gmail_msg">
<br class="gmail_msg">
Tristan<br class="gmail_msg">
<br class="gmail_msg">
>> R.<br class="gmail_msg">
>><br class="gmail_msg">
>> [1]<br class="gmail_msg">
>> <a href="https://github.com/infinispan/infinispan/commit/73d99d37ebfb8af6b64df6a7579a2448deacbde7#diff-e2b618b97769a45ec42eb5910a8c2119R62" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/infinispan/infinispan/commit/73d99d37ebfb8af6b64df6a7579a2448deacbde7#diff-e2b618b97769a45ec42eb5910a8c2119R62</a><br class="gmail_msg">
>><br class="gmail_msg">
>> On 02/28/2017 10:51 PM, William Burns wrote:<br class="gmail_msg">
>>> So while I was trying to work on this, I have to admit I am even more<br class="gmail_msg">
>>> torn in regards to what to do. Looking at [1] it looks like the<br class="gmail_msg">
>>> template should only be applied if the cache configuration is not<br class="gmail_msg">
>>> currently defined. Unfortunately it doesn't work this way and always<br class="gmail_msg">
>>> applies this template to any existing configuration. So I am thinking<br class="gmail_msg">
>>> an alternative is to instead make it work as the documentation states,<br class="gmail_msg">
>>> only using the template if the cache is not currently defined. This<br class="gmail_msg">
>>> seems more logical to me at least.<br class="gmail_msg">
>>><br class="gmail_msg">
>>> With that change the getCache(String, String) could stay as long as it<br class="gmail_msg">
>>> is documented that a template is only applied if no cache<br class="gmail_msg">
>>> configuration exists.<br class="gmail_msg">
>>><br class="gmail_msg">
>>> What do you guys think?<br class="gmail_msg">
>>><br class="gmail_msg">
>>> [1]<br class="gmail_msg">
>>> <a href="https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/manager/EmbeddedCacheManager.java#L84" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/manager/EmbeddedCacheManager.java#L84</a><br class="gmail_msg">
>>><br class="gmail_msg">
>>><br class="gmail_msg">
>>> On Mon, Feb 27, 2017 at 10:09 AM William Burns <<a href="mailto:mudokonman@gmail.com" class="gmail_msg" target="_blank">mudokonman@gmail.com</a><br class="gmail_msg">
>>> <mailto:<a href="mailto:mudokonman@gmail.com" class="gmail_msg" target="_blank">mudokonman@gmail.com</a>>> wrote:<br class="gmail_msg">
>>><br class="gmail_msg">
>>> On Mon, Feb 27, 2017 at 9:55 AM Dan Berindei<br class="gmail_msg">
>>> <<a href="mailto:dan.berindei@gmail.com" class="gmail_msg" target="_blank">dan.berindei@gmail.com</a> <mailto:<a href="mailto:dan.berindei@gmail.com" class="gmail_msg" target="_blank">dan.berindei@gmail.com</a>>> wrote:<br class="gmail_msg">
>>><br class="gmail_msg">
>>> I would go for option 2.<br class="gmail_msg">
>>><br class="gmail_msg">
>>><br class="gmail_msg">
>>> Do you think a WARN message will be enough? I am a bit weary about<br class="gmail_msg">
>>> this option myself.<br class="gmail_msg">
>>><br class="gmail_msg">
>>><br class="gmail_msg">
>>> We already started disconnecting the cache definition and<br class="gmail_msg">
>>> retrieval,<br class="gmail_msg">
>>> at least `getCache(name)` doesn't define a new cache based on the<br class="gmail_msg">
>>> default configuration any more. So I don't think it would be<br class="gmail_msg">
>>> too much,<br class="gmail_msg">
>>> even at this point, to deprecate all the overloads of<br class="gmail_msg">
>>> `getCache` that<br class="gmail_msg">
>>> can define a new cache and advise users to use<br class="gmail_msg">
>>> `defineConfiguration`<br class="gmail_msg">
>>> instead.<br class="gmail_msg">
>>><br class="gmail_msg">
>>><br class="gmail_msg">
>>> Hrmm I like the idea of deprecating the overloads :)<br class="gmail_msg">
>>><br class="gmail_msg">
>>><br class="gmail_msg">
>>><br class="gmail_msg">
>>><br class="gmail_msg">
>>> Cheers<br class="gmail_msg">
>>> Dan<br class="gmail_msg">
>>><br class="gmail_msg">
>>><br class="gmail_msg">
>>> On Mon, Feb 27, 2017 at 4:31 PM, William Burns<br class="gmail_msg">
>>> <<a href="mailto:mudokonman@gmail.com" class="gmail_msg" target="_blank">mudokonman@gmail.com</a> <mailto:<a href="mailto:mudokonman@gmail.com" class="gmail_msg" target="_blank">mudokonman@gmail.com</a>>> wrote:<br class="gmail_msg">
>>> > When working on another project using Infinispan the code<br class="gmail_msg">
>>> being used was a<br class="gmail_msg">
>>> > bit interesting and I don't think our template configuration<br class="gmail_msg">
>>> handling was<br class="gmail_msg">
>>> > expecting it do so in such a way.<br class="gmail_msg">
>>> ><br class="gmail_msg">
>>> > Essentially the code defined a template for a distributed<br class="gmail_msg">
>>> cache as well as<br class="gmail_msg">
>>> > some named caches. Then whenever a cache is retrieved it<br class="gmail_msg">
>>> would pass the<br class="gmail_msg">
>>> > given name and always the distributed cache template.<br class="gmail_msg">
>>> Unfortunately with<br class="gmail_msg">
>>> > the way templates work they essentially redefine a cache<br class="gmail_msg">
>>> first so the actual<br class="gmail_msg">
>>> > cache configuration was wiped out. In this example I was<br class="gmail_msg">
>>> able to get the<br class="gmail_msg">
>>> > code to change to using a default cache instead, which is<br class="gmail_msg">
>>> the behavior that<br class="gmail_msg">
>>> > is needed.<br class="gmail_msg">
>>> ><br class="gmail_msg">
>>> > The issue though at hand is whether we should allow a user<br class="gmail_msg">
>>> to call getCache<br class="gmail_msg">
>>> > in such a way. My initial thought is to have it throw some<br class="gmail_msg">
>>> sort of<br class="gmail_msg">
>>> > configuration exception when this is invoked. But there are<br class="gmail_msg">
>>> some possible<br class="gmail_msg">
>>> > options.<br class="gmail_msg">
>>> ><br class="gmail_msg">
>>> > 1. Throw a configuration exception not allowing a user to<br class="gmail_msg">
>>> use a template<br class="gmail_msg">
>>> > with an already defined cache. This has a slight disconnect<br class="gmail_msg">
>>> between<br class="gmail_msg">
>>> > configuration and runtime, since if a user adds a new<br class="gmail_msg">
>>> definition it could<br class="gmail_msg">
>>> > cause runtime issues.<br class="gmail_msg">
>>> > 2. Log an error/warning message when this occurs. Is this<br class="gmail_msg">
>>> enough though?<br class="gmail_msg">
>>> > Still could have runtime issues that are possibly undetected.<br class="gmail_msg">
>>> > 3. Merge the configurations together applying the template<br class="gmail_msg">
>>> first. This<br class="gmail_msg">
>>> > would be akin to how default cache works currently, but you<br class="gmail_msg">
>>> would get to<br class="gmail_msg">
>>> > define your default template configuration at runtime. This<br class="gmail_msg">
>>> sounded like the<br class="gmail_msg">
>>> > best option to me, but the problem is what if someone calls<br class="gmail_msg">
>>> getCache using<br class="gmail_msg">
>>> > the same cache name but a different template. This could get<br class="gmail_msg">
>>> hairy as well.<br class="gmail_msg">
>>> ><br class="gmail_msg">
>>> > Really thinking about the future, disconnecting the cache<br class="gmail_msg">
>>> definition and<br class="gmail_msg">
>>> > retrieval would be the best option, but we can't do that<br class="gmail_msg">
>>> this late in the<br class="gmail_msg">
>>> > game.<br class="gmail_msg">
>>> ><br class="gmail_msg">
>>> > What do you guys think?<br class="gmail_msg">
>>> ><br class="gmail_msg">
>>> > - Will<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">
>>> <mailto:<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">
>>> _______________________________________________<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">
>>> <mailto:<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">
>>><br class="gmail_msg">
>>><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">
>><br class="gmail_msg">
>><br class="gmail_msg">
>> --<br class="gmail_msg">
>> Radim Vansa <<a href="mailto:rvansa@redhat.com" class="gmail_msg" target="_blank">rvansa@redhat.com</a>><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">
> _______________________________________________<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">
><br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Tristan Tarrant<br class="gmail_msg">
Infinispan Lead<br class="gmail_msg">
JBoss, a division of Red Hat<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>