-
1. Re: regionManager question
ben.wang Mar 23, 2004 8:01 PM (in response to cwampler)Hi,
Thanks for the comment. Currently, "Region" is supported only within LRUPolicy right now (although we will expand that in the next release).
So you don't use Region and RegionManager directly.
Hope this answer your question,
-Ben -
2. Re: regionManager question
cwampler Mar 23, 2004 9:21 PM (in response to cwampler)I understand, and thank you for the swiftness of your reply.
My question then becomes is there a way to dynamically set the timeouts of nodes without using the xml and PropertyConfigurator? Basically a function like this:
int timeOutInSeconds = 60;
cache.setNodeTimeout("/a/b", timeOutInSeconds); -
3. Re: regionManager question
ben.wang Mar 23, 2004 10:08 PM (in response to cwampler)No, we don't support dynamic configuration of eviction policy per node.
If you want to customize the static node behavior, then you can define "Region" to be a finer granualirty. Will this not meet your need?
Thanks,
-Ben -
4. Re: regionManager question
cwampler Mar 24, 2004 1:42 PM (in response to cwampler)I see, so let's say I wanted to use the LRUAlgorithm on node "/a" of my cache to give it a 10 second timeout. In such a case I would declare a regionManager to have my LRUPolicy, grab a region from the manager with a node "/a" and the LRUAlgorithm and set the region timeout. As follows:
cache=new TreeCache(group_name, props, 3000);
// .. instantiate cache code...
cache.start();
LRUAlgorithm algo = new LRUAlgorithm();
LRUPolicy policy = new LRUPolicy();
RegionManager regionManager = new RegionManager(policy);
Region region = regionManager.createRegion("/a", algo);
region.setTimeToIdleSeconds(10);
My question is then how to tie this back into the cache. The treecache has cache.setEvictionPolicyClass(String policy_class), but then how does it know about the region?
Thanks a lot for your patience, and any sample code that could be provided would be greatly appreciated. -
5. Re: regionManager question
ben.wang Mar 24, 2004 2:59 PM (in response to cwampler)No, you can't do it programmatically is what I am saying. But you can do it inside the config xml file, e.g., you specify a region "/a" in there and the TimeToIdleSeconds parameters.
-Ben -
6. Re: regionManager question
rajd Apr 29, 2004 5:33 AM (in response to cwampler)Can't I get the get the region from the RegionManager given the FQN string and then for that region set the idle time ( Assuming that there is only one node in that region)
Thnx,
- Raj -
7. Re: regionManager question
ben.wang May 1, 2004 10:07 AM (in response to cwampler)What you mentioned is doable but not possible right now since RegionManager is not a singleton so user can't obtain the reference directly to mainupulate the eviction policy config directly. But I may consider to provide it in the next major release.
Thanks,
-Ben