-
1. Re: maxNodes in region question
jchico Oct 11, 2005 10:50 AM (in response to jchico)Sorry, I forgot to comment that I'm using TreeCache not TreeCacheAOP, with JBossCache-1.2.4_beta version.
Best Regards.
Jose Angel Chico -
2. Re: maxNodes in region question
manik Oct 14, 2005 3:57 AM (in response to jchico)timeToLiveSeconds or maxAgeSeconds should be set (and should not be 0) otherwise the LRU policy will not evict anything.
-
3. Re: maxNodes in region question
jchico Oct 18, 2005 4:33 AM (in response to jchico)Hello Manik, thanks for the answer.
I was wrong :( . I have downloaded the sources via the CVS repository and after have a look inside the code I have understand how the LRU (and the cache) algorithm works .
My error was suppose that the data in the Map inside a node was evicted too. I have seen a JIRA feature request (JBCACHE-76 / JBCACHE-77) that will do this, am I right?
Thanks again and sorry.
Best regards.
Jose Angel Chico -
4. Re: maxNodes in region question
manik Oct 18, 2005 4:40 AM (in response to jchico)Yes, JBCACHE-77 will fix it - right now only nodes are considered and not the data within the nodes.
-
5. Re: maxNodes in region question
jchico Oct 19, 2005 10:34 AM (in response to jchico)Hello Manik.
Only one little detail. We have been making more testing and we have detected a possible bug.
The parameter MaxAgeSeconds from LRUPolicy is not assigned to the Region in the method
public void configure(TreeCache cache).
The code from JBossCache_1_2_4 branch, LRUPolicy.java is the following:public void configure(TreeCache cache) { cache_ = cache; // Step x. Get the config elem Element elem = cache.getEvictionPolicyConfig(); parseConfig(elem); // Step x. Create LRUAlgorithm and regions // Step x. Create regions regionManager_ = new RegionManager(this); for(int i=0; i< regionValues_.length; i++) { EvictionAlgorithm algo = getEvictionAlgorithm(); try { Region region = regionManager_.createRegion(regionValues_[i].name_, algo); region.setMaxNodes(regionValues_[i].maxNodes_ ); region.setTimeToLiveSeconds(regionValues_[i].timeToLiveSeconds_); } catch (RegionNameConflictException e) { throw new RuntimeException( "LRUPolicy.cacheStarted(): illegal region name specified for eviction policy " + " exception: " +e); } } }
and we suppose it should bepublic void configure(TreeCache cache) { cache_ = cache; // Step x. Get the config elem Element elem = cache.getEvictionPolicyConfig(); parseConfig(elem); // Step x. Create LRUAlgorithm and regions // Step x. Create regions regionManager_ = new RegionManager(this); for(int i=0; i< regionValues_.length; i++) { EvictionAlgorithm algo = getEvictionAlgorithm(); try { Region region = regionManager_.createRegion(regionValues_[i].name_, algo); region.setMaxNodes(regionValues_[i].maxNodes_ ); region.setTimeToLiveSeconds(regionValues_[i].timeToLiveSeconds_); region.setMaxAgeSeconds(regionValues_[i].maxAgeSeconds_); } catch (RegionNameConflictException e) { throw new RuntimeException( "LRUPolicy.cacheStarted(): illegal region name specified for eviction policy " + " exception: " +e); } } }
We have been making tests with this change in the code and it works correctly.
Best regards.
Jose Angel Chico -
6. Re: maxNodes in region question
ben.wang Oct 19, 2005 5:18 PM (in response to jchico)maxAgeSeconds has been deprecated since 1.2. If you read the doc, it is not mentioned anymore. Instead, we use timeToLiveSeconds now.
-Ben -
7. Re: maxNodes in region question
jchico Oct 20, 2005 5:30 AM (in response to jchico)Ooops!!! Sorry again.
We haven't realized it was deprecated. We are using the online doc 'JBossCache Reference Manual' from 1.2.4 Beta, and in this document the parameter 'MaxAgeSeconds' is documented. In the 1.2 Production doc it isn't :(
We are making a lot of tests in order to migrate our old cache (SwarmCache) to JBossCache. The 'MaxAgeSeconds' was an interesting parameter for us.
But if it was deprecated, we prefer not to use it.
Thanks for your quick answer.
Best regards.
Jose Angel Chico -
8. Re: maxNodes in region question
brian.stansberry Oct 20, 2005 1:29 PM (in response to jchico)Thanks for pointing this out. I've removed the reference to maxAgeSeconds from the docs for 1.2.4. final.
-
9. Re: maxNodes in region question
lordbritish Oct 20, 2005 11:59 PM (in response to jchico)I think maxAgeSeconds should be put back.
I think it's useful to have elements evicted after a certain amount of time no matter how many times it was accessed.
Why was this removed?
I doesn't seem to be working in the JBossCache version that I have so it appears it's functionality has also been pulled. -
10. Re: maxNodes in region question
ben.wang Oct 21, 2005 12:33 AM (in response to jchico)Yes, you are right. I think I stated incorrectly. The parameter that got deprecated is timeToIdleSeconds.
maxAgeSeconds was a patch contributed by a user, if I remember it correctly. I will fix it in 1.2.4.
Thanks for pointing it out,
-Ben -
11. Re: maxNodes in region question
lordbritish Oct 21, 2005 1:30 PM (in response to jchico)I'm using the JBoss Cache fro JBoss AS 4.0.2.
So it appears that timeToIdleSeconds is working (but deprecated) and maxAgeSeconds is NOT working and NOT deprecated.
Is that correct?
LOL. -
12. Re: maxNodes in region question
ben.wang Oct 21, 2005 5:11 PM (in response to jchico)Yes, you need more confusion? :-)
Btw, maxAgeSeconds issue should be fixed in 1.2.4.
-Ben -
13. Re: maxNodes in region question
mcevikce Aug 31, 2006 4:06 PM (in response to jchico)"manik.surtani@jboss.com" wrote:
Yes, JBCACHE-77 will fix it - right now only nodes are considered and not the data within the nodes.
If this is fixed does it require different configuration? Because I have tested this with my existing config with LRUPolich and maxNones set to 2. Unfortunalty I was able to insert 5 elemnts to that node.
fqn: /definition/extrainfo key: object1
fqn: /definition/extrainfo key: object2
fqn: /definition/extrainfo key: object3
fqn: /definition/extrainfo key: object4
fqn: /definition/extrainfo key: object5 -
14. Re: maxNodes in region question
manik Sep 6, 2006 7:02 AM (in response to jchico)That is just one node with 5 data keys in it.