jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1477503 - /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/Collision.java
Date Tue, 30 Apr 2013 08:17:31 GMT
Author: mreutegg
Date: Tue Apr 30 08:17:30 2013
New Revision: 1477503

URL: http://svn.apache.org/r1477503
Log:
OAK-619 Lock-free MongoMK implementation
- Conflict handling

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/Collision.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/Collision.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/Collision.java?rev=1477503&r1=1477502&r2=1477503&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/Collision.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/Collision.java
Tue Apr 30 08:17:30 2013
@@ -22,6 +22,8 @@ import javax.annotation.Nonnull;
 
 import org.apache.jackrabbit.mongomk.util.Utils;
 import org.apache.jackrabbit.oak.commons.PathUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
@@ -31,6 +33,8 @@ import static com.google.common.base.Pre
  */
 class Collision {
 
+    private static final Logger log = LoggerFactory.getLogger(Collision.class);
+
     private final Map<String, Object> document;
     private final String theirRev;
     private final UpdateOp ourOp;
@@ -64,7 +68,6 @@ class Collision {
                 }
             }
         }
-        // TODO: detect concurrent commit of previously un-merged changes
         return true;
     }
 
@@ -81,7 +84,11 @@ class Collision {
                 UpdateOp op = new UpdateOp(commitRootPath,
                         Utils.getIdFromPath(commitRootPath), false);
                 op.setMapEntry(UpdateOp.COLLISIONS, revision, true);
+                // TODO: detect concurrent commit of previously un-merged changes
+                // TODO: check _commitRoot for revision is not 'true'
                 store.createOrUpdate(DocumentStore.Collection.NODES, op);
+                log.debug("Marked collision on: {} for {} ({})",
+                        new Object[]{commitRootPath, p, revision});
                 return true;
             }
         }



Mime
View raw message