[
http://jira.jboss.com/jira/browse/JBCACHE-1149?page=comments#action_12370331 ]
Manik Surtani commented on JBCACHE-1149:
----------------------------------------
Could it be that your region isn't recognised correctly?
Region rn = getCache().getRegion(Fqn.fromString("\a\b\c"), true);
Perhaps you got the slashes the wrong way around? This way your policy is created and
applied to a new region under /"\a\b\c" ahdn when you put something in /
"a" / "b" / "c" it goes into a different (default) region.
I've added the quotes to each Fqn element above to make the distinction more clear.
FIFOPolicy is adding a visited node to the evictionqueue
--------------------------------------------------------
Key: JBCACHE-1149
URL:
http://jira.jboss.com/jira/browse/JBCACHE-1149
Project: JBoss Cache
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Eviction, MonthOfBugs_200
Affects Versions: 2.0.0.CR2
Environment: OS: WIn XP SP2; JBOSS AS: 4.0.3; Cache : 2.0.0CR2
Reporter: Maddulety Vankadara
Assigned To: Manik Surtani
Fix For: 2.0.0.GA
Created Eviction Policy with the following config:
<attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalSeconds">30</attribute>
<attribute name="eventQueueSize">200000</attribute>
<!-- Cache wide default -->
<region name="/_default_"
policyClass="org.jboss.cache.eviction.FIFOPolicy">
<attribute name="maxNodes">500</attribute>
</region>
</config>
</attribute>
And then created a region programmatically and assigned FIFOPolicy to that region.
FIFOConfiguration evictionConfig = new FIFOConfiguration();
evictionConfig.setMaxNodes(CacheConstants.60);
Region rn = getCache().getRegion(Fqn.fromString("\a\b\c"), true);
rn.setEvictionPolicy(evictionConfig);
Add some nodes under "/a/b/c". All nodes are added to the evictionqueue
properly.
But when I traverse the region /a/b/c, This node is also added to the evictionqueue and
when the queue reaches the limit "MAXNodes"( which is 60 here), the node /a/b/c
is evicted from cache.
I think a visted node should not be evicted in a FIFO policy.
After going through the code, I noticed that VISIT_NODE_EVENT is not ignored in the
FIFOPolicy class.
Overriding the bemow method in org.jboss.cache.eviction.FIFOPolicy will fix the issue:
public boolean canIgnoreEvent(Fqn fqn, NodeEventType eventType) {
return (eventType == NodeEventType.VISIT_NODE_EVENT);
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira