[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Manik Surtani
manik at jboss.org
Mon Jul 16 19:43:37 EDT 2007
User: msurtani
Date: 07/07/16 19:43:37
Modified: src/org/jboss/cache/interceptors
CacheLoaderInterceptor.java
CacheStoreInterceptor.java
Log:
JBCACHE-1133
Revision Changes Path
1.90 +14 -8 JBossCache/src/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheLoaderInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/CacheLoaderInterceptor.java,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -b -r1.89 -r1.90
--- CacheLoaderInterceptor.java 12 Jul 2007 17:04:36 -0000 1.89
+++ CacheLoaderInterceptor.java 16 Jul 2007 23:43:37 -0000 1.90
@@ -25,7 +25,7 @@
* Loads nodes that don't exist at the time of the call into memory from the CacheLoader
*
* @author Bela Ban
- * @version $Id: CacheLoaderInterceptor.java,v 1.89 2007/07/12 17:04:36 msurtani Exp $
+ * @version $Id: CacheLoaderInterceptor.java,v 1.90 2007/07/16 23:43:37 msurtani Exp $
*/
public class CacheLoaderInterceptor extends Interceptor implements CacheLoaderInterceptorMBean
{
@@ -91,6 +91,7 @@
case MethodDeclarations.putForExternalReadMethodLocal_id:
case MethodDeclarations.putKeyValMethodLocal_id:
fqn = (Fqn) args[1];
+ key = args[2];
if (useCacheStore)
{
initNode = true;
@@ -290,20 +291,25 @@
{
if (n == null)
{
- log.trace("mustLoad, node null");
+ log.trace("must load, node null");
return true;
}
+ // if we are not looking for a specific key don't bother loading!
+ if (key == null)
+ {
+ log.trace("don't load, key requested is null");
+ return false;
+ }
+ if (n.getKeys().contains(key))
+ {
+ log.trace("don't load, already have necessary key in memory");
+ return false;
+ }
if (!n.isDataLoaded())
{
log.trace("must Load, uninitialized");
return true;
}
- /*
- if (!n.getKeys().contains(key)) {
- log.trace("must Load, no key");
- return true;
- }
- */
return false;
}
1.53 +19 -15 JBossCache/src/org/jboss/cache/interceptors/CacheStoreInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheStoreInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/CacheStoreInterceptor.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- CacheStoreInterceptor.java 13 Jul 2007 12:37:02 -0000 1.52
+++ CacheStoreInterceptor.java 16 Jul 2007 23:43:37 -0000 1.53
@@ -28,7 +28,7 @@
* through the CacheLoader, either after each method call (no TXs), or at TX commit.
*
* @author Bela Ban
- * @version $Id: CacheStoreInterceptor.java,v 1.52 2007/07/13 12:37:02 msurtani Exp $
+ * @version $Id: CacheStoreInterceptor.java,v 1.53 2007/07/16 23:43:37 msurtani Exp $
*/
public class CacheStoreInterceptor extends Interceptor implements CacheStoreInterceptorMBean
{
@@ -188,7 +188,11 @@
case MethodDeclarations.putDataEraseMethodLocal_id:
// aside from this removeData call, this is the same as a putData call. Needed since CacheLoader.put(Map)
// does not overwrite but append.
- loader.removeData((Fqn) args[1]);
+ fqn = (Fqn) args[1];
+ loader.removeData(fqn);
+ // if we are erasing all the data then consider this node loaded
+ NodeSPI n = cache.peek(fqn, false);
+ n.setDataLoaded(true);
case MethodDeclarations.putDataMethodLocal_id:
loader.put((Fqn) args[1], (Map) args[2]);
if (configuration.getExposeManagementStatistics() && getStatisticsEnabled())
More information about the jboss-cvs-commits
mailing list