activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1301145 - /activemq/trunk/kahadb/src/main/java/org/apache/kahadb/index/ListIndex.java
Date Thu, 15 Mar 2012 18:57:13 GMT
Author: tabish
Date: Thu Mar 15 18:57:13 2012
New Revision: 1301145

URL: http://svn.apache.org/viewvc?rev=1301145&view=rev
Log:
fixes for: https://issues.apache.org/jira/browse/AMQ-3768

Adds some additional eager cache invalidation to ensure we don't use stale nodes

Modified:
    activemq/trunk/kahadb/src/main/java/org/apache/kahadb/index/ListIndex.java

Modified: activemq/trunk/kahadb/src/main/java/org/apache/kahadb/index/ListIndex.java
URL: http://svn.apache.org/viewvc/activemq/trunk/kahadb/src/main/java/org/apache/kahadb/index/ListIndex.java?rev=1301145&r1=1301144&r2=1301145&view=diff
==============================================================================
--- activemq/trunk/kahadb/src/main/java/org/apache/kahadb/index/ListIndex.java (original)
+++ activemq/trunk/kahadb/src/main/java/org/apache/kahadb/index/ListIndex.java Thu Mar 15
18:57:13 2012
@@ -155,6 +155,7 @@ public class ListIndex<Key,Value> implem
                 oldValue = lastGetEntryCache.setValue(value);
                 lastGetEntryCache.setValue(value);
                 lastGetNodeCache.storeUpdate(tx);
+                flushCache();
                 return oldValue;
             }
 
@@ -166,6 +167,7 @@ public class ListIndex<Key,Value> implem
                 if (entry.getKey().equals(key)) {
                     oldValue = entry.setValue(value);
                     ((ListIterator) iterator).getCurrent().storeUpdate(tx);
+                    flushCache();
                     return oldValue;
                 }
             }
@@ -182,11 +184,14 @@ public class ListIndex<Key,Value> implem
             if (entry.getKey().equals(key)) {
                 oldValue = entry.setValue(value);
                 ((ListIterator) iterator).getCurrent().storeUpdate(tx);
+                flushCache();
                 return oldValue;
             }
         }
 
         // Not found so add it last.
+        flushCache();
+
         return add(tx, key, value);
     }
 
@@ -194,6 +199,7 @@ public class ListIndex<Key,Value> implem
         assertLoaded();
         getTail(tx).put(tx, key, value);
         size.incrementAndGet();
+        flushCache();
         return null;
     }
 
@@ -201,6 +207,7 @@ public class ListIndex<Key,Value> implem
         assertLoaded();
         getHead(tx).addFirst(tx, key, value);
         size.incrementAndGet();
+        flushCache();
         return null;
     }
 



Mime
View raw message