[infinispan-dev] EmbeddedCacheManager needs getRunningCacheNames, doesn't it?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[infinispan-dev] EmbeddedCacheManager needs getRunningCacheNames, doesn't it?

Galder Zamarreño-3
Guys,

This (http://community.jboss.org/message/592436#592436) thread brought up an interesting limitation of our CacheManager API.

Let's say you wanna remove all caches within a cache manager, and by remote I mean not only clear the in memory contents, but also the cache store stuff (so, similar to what is suggested in https://issues.jboss.org/browse/ISPN-905 but at the cache manager level)

I don't think this is such a common use case to require a removeAllCaches() at the CacheManager level (or maybe it does?). One would imagine that given a removeCache(name), you should be able to get all cache names and loop through them. However, there's no such method. We have getCacheNames() but that's only limited to the cache names that have predefined either via XML, as <namedCache>, or programmatically via defineConfiguration. Any other cache that might have been started and whose name was not predefined would be a running a cache based on the default config. However, there's no way to find out about all these caches.

So, rather than providing removeAllCaches(), it might more interesting to provide: getRunningCacheNames() which would be getCacheNames() + (undefined caches that have been started which are based on default config). Or maybe we wanna provide both!

Clearly, something for 5.0.

Thoughts?
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] EmbeddedCacheManager needs getRunningCacheNames, doesn't it?

Patrick McFarland
No, getCacheNames() should _already_ list everything thats defined
and/or running. .stop() and .removeCache() should happily no op on
stopped/non-existent caches.

On Fri, Mar 11, 2011 at 11:22 AM, Galder Zamarreño
<[hidden email]> wrote:

> Guys,
>
> This (http://community.jboss.org/message/592436#592436) thread brought up an interesting limitation of our CacheManager API.
>
> Let's say you wanna remove all caches within a cache manager, and by remote I mean not only clear the in memory contents, but also the cache store stuff (so, similar to what is suggested in https://issues.jboss.org/browse/ISPN-905 but at the cache manager level)
>
> I don't think this is such a common use case to require a removeAllCaches() at the CacheManager level (or maybe it does?). One would imagine that given a removeCache(name), you should be able to get all cache names and loop through them. However, there's no such method. We have getCacheNames() but that's only limited to the cache names that have predefined either via XML, as <namedCache>, or programmatically via defineConfiguration. Any other cache that might have been started and whose name was not predefined would be a running a cache based on the default config. However, there's no way to find out about all these caches.
>
> So, rather than providing removeAllCaches(), it might more interesting to provide: getRunningCacheNames() which would be getCacheNames() + (undefined caches that have been started which are based on default config). Or maybe we wanna provide both!
>
> Clearly, something for 5.0.
>
> Thoughts?
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>



--
Patrick "Diablo-D3" McFarland || www.AdTerrasPerAspera.com
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd
all be running around in darkened rooms, munching magic pills and listening to
repetitive electronic music." -- Kristian Wilson, Nintendo, Inc, 1989

_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] EmbeddedCacheManager needs getRunningCacheNames, doesn't it?

Manik Surtani
+1

On 12 Mar 2011, at 17:42, Patrick McFarland wrote:

> No, getCacheNames() should _already_ list everything thats defined
> and/or running. .stop() and .removeCache() should happily no op on
> stopped/non-existent caches.
>
> On Fri, Mar 11, 2011 at 11:22 AM, Galder Zamarreño
> <[hidden email]> wrote:
>> Guys,
>>
>> This (http://community.jboss.org/message/592436#592436) thread brought up an interesting limitation of our CacheManager API.
>>
>> Let's say you wanna remove all caches within a cache manager, and by remote I mean not only clear the in memory contents, but also the cache store stuff (so, similar to what is suggested in https://issues.jboss.org/browse/ISPN-905 but at the cache manager level)
>>
>> I don't think this is such a common use case to require a removeAllCaches() at the CacheManager level (or maybe it does?). One would imagine that given a removeCache(name), you should be able to get all cache names and loop through them. However, there's no such method. We have getCacheNames() but that's only limited to the cache names that have predefined either via XML, as <namedCache>, or programmatically via defineConfiguration. Any other cache that might have been started and whose name was not predefined would be a running a cache based on the default config. However, there's no way to find out about all these caches.
>>
>> So, rather than providing removeAllCaches(), it might more interesting to provide: getRunningCacheNames() which would be getCacheNames() + (undefined caches that have been started which are based on default config). Or maybe we wanna provide both!
>>
>> Clearly, something for 5.0.
>>
>> Thoughts?
>> --
>> Galder Zamarreño
>> Sr. Software Engineer
>> Infinispan, JBoss Cache
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>
>
>
> --
> Patrick "Diablo-D3" McFarland || www.AdTerrasPerAspera.com
> "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd
> all be running around in darkened rooms, munching magic pills and listening to
> repetitive electronic music." -- Kristian Wilson, Nintendo, Inc, 1989
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
[hidden email]
twitter.com/maniksurtani

Lead, Infinispan
http://www.infinispan.org




_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] EmbeddedCacheManager needs getRunningCacheNames, doesn't it?

Galder Zamarreno
That should work too and probably makes sense fixing it for 4.2.x too:

https://issues.jboss.org/browse/ISPN-981

On Mar 14, 2011, at 1:38 PM, Manik Surtani wrote:

> +1
>
> On 12 Mar 2011, at 17:42, Patrick McFarland wrote:
>
>> No, getCacheNames() should _already_ list everything thats defined
>> and/or running. .stop() and .removeCache() should happily no op on
>> stopped/non-existent caches.
>>
>> On Fri, Mar 11, 2011 at 11:22 AM, Galder Zamarreño
>> <[hidden email]> wrote:
>>> Guys,
>>>
>>> This (http://community.jboss.org/message/592436#592436) thread brought up an interesting limitation of our CacheManager API.
>>>
>>> Let's say you wanna remove all caches within a cache manager, and by remote I mean not only clear the in memory contents, but also the cache store stuff (so, similar to what is suggested in https://issues.jboss.org/browse/ISPN-905 but at the cache manager level)
>>>
>>> I don't think this is such a common use case to require a removeAllCaches() at the CacheManager level (or maybe it does?). One would imagine that given a removeCache(name), you should be able to get all cache names and loop through them. However, there's no such method. We have getCacheNames() but that's only limited to the cache names that have predefined either via XML, as <namedCache>, or programmatically via defineConfiguration. Any other cache that might have been started and whose name was not predefined would be a running a cache based on the default config. However, there's no way to find out about all these caches.
>>>
>>> So, rather than providing removeAllCaches(), it might more interesting to provide: getRunningCacheNames() which would be getCacheNames() + (undefined caches that have been started which are based on default config). Or maybe we wanna provide both!
>>>
>>> Clearly, something for 5.0.
>>>
>>> Thoughts?
>>> --
>>> Galder Zamarreño
>>> Sr. Software Engineer
>>> Infinispan, JBoss Cache
>>>
>>>
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>>
>>
>>
>>
>> --
>> Patrick "Diablo-D3" McFarland || www.AdTerrasPerAspera.com
>> "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd
>> all be running around in darkened rooms, munching magic pills and listening to
>> repetitive electronic music." -- Kristian Wilson, Nintendo, Inc, 1989
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Manik Surtani
> [hidden email]
> twitter.com/maniksurtani
>
> Lead, Infinispan
> http://www.infinispan.org
>
>
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev