commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject Re: [JCS]--How to get a list of Keys in a region
Date Sat, 14 Jan 2012 09:43:56 GMT
On 13.01.12 15:59, Chopin hu wrote:
> Vijayakumar,
> 
> Thanks for your response.   The method cache.putInGroup() does not seem to really work
in my case.   I am working a simple commandline utility, which will extract all keys from
a cache region.   No key/value can be known in advance.   Besides, I don't understand the
concept of "groupName" yet in a cache region.   It looks I don't have a group name either.
> 
> But is this some method that I can trick it so that it can return all cache keys from
a region?
> 
> 
> 
> --- On Fri, 1/13/12, NM, Vijayakumar <vijayakumar.nm@capgemini.com> wrote:
> 
> From: NM, Vijayakumar <vijayakumar.nm@capgemini.com>
> Subject: RE: [JCS]--How to get a list of Keys in a region
> To: "Commons Users List" <user@commons.apache.org>
> Date: Friday, January 13, 2012, 12:41 AM
> 
> Hi,
> 
> This may be of some help.
> 
> JCS cache = JCS.getInstance(regionName);
> cache.putInGroup(key, groupName, value);
> 
> Set keys = cache.getGroupKeys(groupName)

This is the actual trick. Just invent some group name and put all your
keys and values into that group. Then you can get a list of keys by
calling getGroupKeys(). It would be more or less an additional wrapper
in your region.

Bye, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message