-
1. Re: Create an eviction Region with a non empty nodeEventQueu
mircea.markus May 7, 2008 5:08 AM (in response to sancheski)At the moment that is just not supported. Not sure we even want to support that as it might create unnecessary complications, but rather not allow creating the eviction region if the given region is not empty - I'll raise another question on the design forums on that.
The only way I see you can solve this is to create a new empty region and move the nodes from the existing one, so that events are being created and nodes are being considered for eviction. -
2. Re: Create an eviction Region with a non empty nodeEventQueu
mircea.markus May 7, 2008 5:21 AM (in response to sancheski)I've added a post on the design forum: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4149030#4149030
-
3. Re: Create an eviction Region with a non empty nodeEventQueu
sancheski May 7, 2008 5:43 AM (in response to sancheski)
The only way I see you can solve this is to create a new empty region and move the nodes from the existing one, so that events are being created and nodes are being considered for eviction.
I thought about that solution too but this would made the nodes to lose their state. They would not keep their primitive state, are they?
Thanks a lot! -
4. Re: Create an eviction Region with a non empty nodeEventQueu
manik May 7, 2008 9:36 AM (in response to sancheski)I'm confused - how are you creating the eviction region? Isn't this in the XML config file (or Configuration object), which means the region will be created when the cache starts up?
-
5. Re: Create an eviction Region with a non empty nodeEventQueu
sancheski May 7, 2008 9:58 AM (in response to sancheski)I have a requirement in my application that forces me to create eviction policies to regions once the whole system is running (that is, the cache has already started and is runnning properly).
What I am triying to do is to configure an eviction policy programatically. Here is how I am doing it:public final void addEvictionPolicy(EvictionPolicy evictionPolicy, EvictionConfiguration evictionConfig, String fqn) { // Activate eviction Policies RegionManager regionMgr = getUnderlyingTreeCache().getEvictionRegionManager(); if (regionMgr.hasRegion(fqn)) { Region region = regionMgr.getRegion(fqn); region.setEvictionConfiguration(evictionConfig); logger.debug("Region[{}] configured with {}", fqn, evictionPolicy); } else { evictionPolicy.configure(getUnderlyingTreeCache()); try { regionMgr.createRegion(fqn, evictionPolicy, evictionConfig); } catch (RegionNameConflictException e) { logger.error("Region Name conflict", e); } logger.debug( "Region[{}] does not exist in RegionManager. Created and configured with {}", fqn, evictionPolicy); } }
I do not know if there is a better way to create an eviction policy dinamically. Does any one know how to do it properly?
Thanks!