[infinispan-commits] Infinispan SVN: r2095 - trunk/query/src/main/java/org/infinispan/query/backend.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Fri Jul 23 06:49:59 EDT 2010


Author: navssurtani
Date: 2010-07-23 06:49:59 -0400 (Fri, 23 Jul 2010)
New Revision: 2095

Modified:
   trunk/query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java
Log:
[ISPN-548] Edited up issue of CacheEntry.isUpdated(). Removed System.outs as well :)

Modified: trunk/query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java	2010-07-22 19:33:38 UTC (rev 2094)
+++ trunk/query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java	2010-07-23 10:49:59 UTC (rev 2095)
@@ -35,6 +35,7 @@
 import org.infinispan.factories.annotations.Inject;
 import org.infinispan.interceptors.base.CommandInterceptor;
 import org.infinispan.marshall.MarshalledValue;
+import org.infinispan.util.logging.Log;
 
 import javax.transaction.TransactionManager;
 import java.io.Serializable;
@@ -81,17 +82,17 @@
          // otherwise we need to be updating the indexes as opposed to simply adding to the indexes.
          Object key = command.getKey();
          Object value = command.getValue();
-         System.out.println("Key, value pairing is: - " + key + " + " + value);
+         if(log.isDebugEnabled()) log.debug("Key, value pairing is: - " + key + " + " + value);
          CacheEntry entry = ctx.lookupEntry(key);
 
          // New entry so we will add it to the indexes.
          if(entry.isCreated()) {
-            System.out.println("Entry is created");
+            if(log.isDebugEnabled()) log.debug("Entry is created");
             addToIndexes(extractValue(value), extractValue(key));
          }
-         // Updated entry so we are going to update the indexes and not add them.
-         if(entry.isChanged()){
-            System.out.println("Entry is changed");            
+         else{
+            // This means that the entry is just modified so we need to update the indexes and not add to them.
+            if(log.isDebugEnabled()) log.debug("Entry is changed");
             updateIndexes(extractValue(value), extractValue(key));
          }
 
@@ -144,6 +145,8 @@
 
    @Override
    public Object visitClearCommand(InvocationContext ctx, ClearCommand command) throws Throwable {
+
+      // This method is called when somebody calls a cache.clear() and we will need to wipe everything in the indexes.
       Object returnValue = invokeNextInterceptor(ctx, command);
 
       if (shouldModifyIndexes(ctx)) {



More information about the infinispan-commits mailing list