jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r801901 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
Date Fri, 07 Aug 2009 07:34:42 GMT
Author: thomasm
Date: Fri Aug  7 07:34:42 2009
New Revision: 801901

URL: http://svn.apache.org/viewvc?rev=801901&view=rev
Log:
JCR-2241 Data Store: garbage collection should ignore removed properties

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java?rev=801901&r1=801900&r2=801901&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
Fri Aug  7 07:34:42 2009
@@ -29,6 +29,8 @@
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.spi.Name;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -70,6 +72,9 @@
  */
 public class GarbageCollector {
 
+    /** logger instance */
+    private static final Logger LOG = LoggerFactory.getLogger(GarbageCollector.class);
+
     private ScanEventListener callback;
 
     private int sleepBetweenNodes;
@@ -309,21 +314,25 @@
         try {
             for (PropertyIterator it = n.getProperties(); it.hasNext();) {
                 Property p = it.nextProperty();
-                if (p.getType() == PropertyType.BINARY) {
-                    if (n.hasProperty("jcr:uuid")) {
-                        rememberNode(n.getProperty("jcr:uuid").getString());
-                    } else {
-                        rememberNode(n.getPath());
-                    }
-                    if (p.getDefinition().isMultiple()) {
-                        p.getLengths();
-                    } else {
-                        p.getLength();
+                try {
+                    if (p.getType() == PropertyType.BINARY) {
+                        if (n.hasProperty("jcr:uuid")) {
+                            rememberNode(n.getProperty("jcr:uuid").getString());
+                        } else {
+                            rememberNode(n.getPath());
+                        }
+                        if (p.getDefinition().isMultiple()) {
+                            p.getLengths();
+                        } else {
+                            p.getLength();
+                        }
                     }
+                } catch (InvalidItemStateException e) {
+                    LOG.debug("Property removed concurrently - ignoring", e);
                 }
             }
         } catch (InvalidItemStateException e) {
-            // the property may have been removed in the meantime - ignore
+            LOG.debug("Node removed concurrently - ignoring", e);
         }
         if (callback != null) {
             callback.afterScanning(n);
@@ -333,7 +342,7 @@
                 recurse(it.nextNode(), sleep);
             }
         } catch (InvalidItemStateException e) {
-            // the item may have been removed in the meantime - ignore
+            LOG.debug("Node removed concurrently - ignoring", e);
         }
     }
 



Mime
View raw message