jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1537444 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/mongomk/ test/java/org/apache/jackrabbit/oak/ test/java/org/apache/jackrabbit/oak/core/ test/java/org/apache/jackrabbit/oak/kernel/
Date Thu, 31 Oct 2013 11:24:14 GMT
Author: mreutegg
Date: Thu Oct 31 11:24:14 2013
New Revision: 1537444

URL: http://svn.apache.org/r1537444
Log:
OAK-1080: MongoMK: improved concurrency
- enable MongoNodeStore in parameterized tests

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeState.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/OakBaseTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeState.java?rev=1537444&r1=1537443&r2=1537444&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeState.java
Thu Oct 31 11:24:14 2013
@@ -43,6 +43,7 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
@@ -50,6 +51,7 @@ import com.google.common.collect.Lists;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 import static java.util.Collections.emptyList;
+import static org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.EMPTY_NODE;
 import static org.apache.jackrabbit.oak.plugins.memory.PropertyStates.createProperty;
 
 /**
@@ -188,6 +190,26 @@ final class MongoNodeState extends Abstr
         }
     }
 
+    @Override
+    public boolean compareAgainstBaseState(NodeState base, NodeStateDiff diff) {
+        if (this == base) {
+            return true;
+        } else if (base == EMPTY_NODE || !base.exists()) { // special case
+            return EmptyNodeState.compareAgainstEmptyState(this, diff);
+        } else if (base instanceof MongoNodeState) {
+            MongoNodeState mBase = (MongoNodeState) base;
+            if (store == mBase.store) {
+                if (node.getLastRevision().equals(mBase.node.getLastRevision())
+                        && getPath().equals(mBase.getPath())) {
+                    return true; // no differences
+                }
+                // TODO: use diff, similar to KernelNodeState
+            }
+        }
+        // fall back to the generic node state diff algorithm
+        return super.compareAgainstBaseState(base, diff);
+    }
+
     //------------------------------< internal >--------------------------------
 
     /**

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/OakBaseTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/OakBaseTest.java?rev=1537444&r1=1537443&r2=1537444&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/OakBaseTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/OakBaseTest.java
Thu Oct 31 11:24:14 2013
@@ -39,6 +39,7 @@ public abstract class OakBaseTest {
         Object[][] fixtures = new Object[][] {
                 {NodeStoreFixture.MK_IMPL},
                 {NodeStoreFixture.MONGO_MK},
+                {NodeStoreFixture.MONGO_NS},
                 {NodeStoreFixture.SEGMENT_MK},
         };
         return Arrays.asList(fixtures);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java?rev=1537444&r1=1537443&r2=1537444&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java
Thu Oct 31 11:24:14 2013
@@ -46,8 +46,9 @@ public class LargeMoveTestIT extends Oak
 
     @Before
     public void setUp() throws CommitFailedException {
-        // FIXME slow on MongoMK. See OAK-964
-        assumeTrue(fixture != NodeStoreFixture.MONGO_MK);
+        // FIXME slow on MongoMK and MongoNS. See OAK-964
+        assumeTrue(fixture != NodeStoreFixture.MONGO_MK
+                && fixture != NodeStoreFixture.MONGO_NS);
 
         session = createContentSession();
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java?rev=1537444&r1=1537443&r2=1537444&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootFuzzIT.java
Thu Oct 31 11:24:14 2013
@@ -62,6 +62,7 @@ public class RootFuzzIT {
         Object[][] fixtures = new Object[][] {
                 {NodeStoreFixture.MK_IMPL},
                 {NodeStoreFixture.MONGO_MK},
+                {NodeStoreFixture.MONGO_NS},
                 {NodeStoreFixture.SEGMENT_MK},
         };
         return Arrays.asList(fixtures);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java?rev=1537444&r1=1537443&r2=1537444&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java
Thu Oct 31 11:24:14 2013
@@ -57,6 +57,7 @@ public class NodeStoreTest {
         Object[][] fixtures = new Object[][] {
                 {NodeStoreFixture.MK_IMPL},
                 {NodeStoreFixture.MONGO_MK},
+                {NodeStoreFixture.MONGO_NS},
                 {NodeStoreFixture.SEGMENT_MK},
         };
         return Arrays.asList(fixtures);



Mime
View raw message