jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1486955 - in /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk: MongoMK.java UnmergedBranches.java
Date Tue, 28 May 2013 15:08:21 GMT
Author: mreutegg
Date: Tue May 28 15:08:20 2013
New Revision: 1486955

URL: http://svn.apache.org/r1486955
Log:
OAK-619 Lock-free MongoMK implementation
- Use Revision comparator from MongoMK in UnmergedBranches

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

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java?rev=1486955&r1=1486954&r2=1486955&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java
Tue May 28 15:08:20 2013
@@ -180,7 +180,7 @@ public class MongoMK implements MicroKer
      */
     // TODO at some point, open (unmerged) branches
     // need to be garbage collected (in-memory and on disk)
-    private final UnmergedBranches branches = new UnmergedBranches();
+    private final UnmergedBranches branches;
 
     private boolean stopBackground;
     
@@ -202,6 +202,7 @@ public class MongoMK implements MicroKer
         
         this.revisionComparator = new RevisionComparator(clusterId);
         this.asyncDelay = builder.getAsyncDelay();
+        this.branches = new UnmergedBranches(revisionComparator);
 
         //TODO Use size based weigher
         nodeCache = CacheBuilder.newBuilder()
@@ -1116,7 +1117,6 @@ public class MongoMK implements MicroKer
      * 
      * @param nodeMap the document
      * @param changeRev the revision of the current change
-     * @param onlyCommitted whether only committed changes should be considered
      * @param handler the conflict handler, which is called for un-committed revisions
      *                preceding <code>before</code>.
      * @return the revision, or null if deleted
@@ -1265,7 +1265,7 @@ public class MongoMK implements MicroKer
                 // remove from branchCommits map after successful update
                 branches.remove(b);
             } else {
-                throw new MicroKernelException("Conflicting concurrent change");
+                throw new MicroKernelException("Conflicting concurrent change. Update operation
failed: " + op);
             }
         } else {
             // no commits in this branch -> do nothing

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/UnmergedBranches.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/UnmergedBranches.java?rev=1486955&r1=1486954&r2=1486955&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/UnmergedBranches.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/UnmergedBranches.java
Tue May 28 15:08:20 2013
@@ -51,8 +51,11 @@ class UnmergedBranches {
     /**
      * The revision comparator.
      */
-    // TODO use the same comparator as MongoMK?
-    private final Revision.RevisionComparator comparator = new Revision.RevisionComparator(0);
+    private final Revision.RevisionComparator comparator;
+
+    UnmergedBranches(@Nonnull Revision.RevisionComparator comparator) {
+        this.comparator = checkNotNull(comparator);
+    }
 
     /**
      * Initialize with un-merged branches from <code>store</code> for this



Mime
View raw message