[jboss-user] [JBoss Cache: Core Edition] - LRUPolicy eviction policy

lovelyliatroim do-not-reply at jboss.com
Mon Oct 27 09:39:15 EDT 2008


Just something i found confusing when reading the documents.

In the documentation it states maxNodes as follows for LRUPolicy

 

anonymous wrote : 
  | # maxNodes  - This is the maximum number of nodes allowed in this region. 0 denotes no limit. 
  | 

So if i have something like configured 



  | <region name="evictiontest/LRU" policyClass="org.jboss.cache.eviction.LRUPolicy">
  |                   <attribute name="maxNodes">3</attribute>
  |                   <attribute name="timeToLiveSeconds">0</attribute>
  |                   <attribute name="maxAgeSeconds">10</attribute>
  |             </region>
  | 

Now if I add 10 elements like so to the cache 
evictiontest/LRU/a/b/c1(1)
evictiontest/LRU/a/b/c2(1)
evictiontest/LRU/a/b/c3(1)
evictiontest/LRU/a/b/c4(1)

etc 

After eviction i would have expected to see just one record in the cache
evictiontest/LRU/a/b/c*(1)
 
however I see 3 records 
evictiontest/LRU/a/b/c1(1)
evictiontest/LRU/a/b/c2(1)
evictiontest/LRU/a/b/c3(1)

So when i have set maxNodes to 3, does it actually mean 3 nodes which have a data item attached to the node?? I was thinking it was 3 nodes in total allowed from the region base hence why i thought one record would be allowed.

So breakdown of 
evictiontest/LRU/a/b/c1(1)

a = 1 node
b = 2 nodes
c1 = 3 nodes so no more nodes should be allowed in this region!!


I have done the test on it and looks to me like its based on nodes with data attached, could someone just confirm this for me on how it works. 

Thanks,
LL



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184848#4184848

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184848



More information about the jboss-user mailing list