jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1540640 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk: Commit.java MongoNodeStoreBranch.java
Date Mon, 11 Nov 2013 08:54:44 GMT
Author: mreutegg
Date: Mon Nov 11 08:54:44 2013
New Revision: 1540640

URL: http://svn.apache.org/r1540640
Log:
OAK-1080: MongoMK: improved concurrency
- do not create new head revision for empty commit

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Commit.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStoreBranch.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Commit.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Commit.java?rev=1540640&r1=1540639&r2=1540640&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Commit.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Commit.java
Mon Nov 11 08:54:44 2013
@@ -135,6 +135,10 @@ public class Commit {
         addedNodes.add(n.path);
     }
 
+    boolean isEmpty() {
+        return operations.isEmpty();
+    }
+
     /**
      * Apply the changes to the document store and the cache.
      */

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStoreBranch.java?rev=1540640&r1=1540639&r2=1540640&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStoreBranch.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStoreBranch.java
Mon Nov 11 08:54:44 2013
@@ -162,6 +162,11 @@ public class MongoNodeStoreBranch
         Revision rev;
         try {
             op.with(c);
+            if (c.isEmpty()) {
+                // no changes to persist. return base state and let
+                // finally clause cancel the commit
+                return base;
+            }
             rev = store.apply(c);
             success = true;
         } finally {



Mime
View raw message