jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1333014 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/core/ main/java/org/apache/jackrabbit/oak/kernel/ test/java/org/apache/jackrabbit/oak/core/ test/java/org/apache/jackrabbit/oak/query/
Date Wed, 02 May 2012 12:32:53 GMT
Author: mduerig
Date: Wed May  2 12:32:52 2012
New Revision: 1333014

URL: http://svn.apache.org/viewvc?rev=1333014&view=rev
Log:
OAK-80: Implement batched writing for KernelNodeStore
Rename KernelNodeStateBuilder2 and  KernelNodeStore2 to KernelNodeStateBuilder and KernelNodeStore,
respectively.

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
      - copied, changed from r1333010, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder2.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
      - copied, changed from r1333010, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore2.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder2.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore2.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/AbstractOakTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java?rev=1333014&r1=1333013&r2=1333014&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
Wed May  2 12:32:52 2012
@@ -22,7 +22,7 @@ import org.apache.jackrabbit.mk.index.In
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.QueryEngine;
-import org.apache.jackrabbit.oak.kernel.KernelNodeStore2;
+import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
 import org.apache.jackrabbit.oak.query.QueryEngineImpl;
 import org.apache.jackrabbit.oak.spi.QueryIndexProvider;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -79,7 +79,7 @@ public class ContentRepositoryImpl imple
      */
     public ContentRepositoryImpl(MicroKernel mk, QueryIndexProvider indexProvider) {
         microKernel = mk;
-        nodeStore = new KernelNodeStore2(microKernel);
+        nodeStore = new KernelNodeStore(microKernel);
         queryEngine = new QueryEngineImpl(nodeStore, microKernel, indexProvider);
 
         // FIXME: workspace setup must be done elsewhere...

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
(from r1333010, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder2.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder2.java&r1=1333010&r2=1333014&rev=1333014&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder2.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
Wed May  2 12:32:52 2012
@@ -3,24 +3,24 @@ package org.apache.jackrabbit.oak.kernel
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.kernel.KernelNodeStore2.NodeStateBuilderContext;
+import org.apache.jackrabbit.oak.kernel.KernelNodeStore.NodeStateBuilderContext;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStateBuilder;
 
 import java.util.List;
 
-public class KernelNodeStateBuilder2 implements NodeStateBuilder {
+public class KernelNodeStateBuilder implements NodeStateBuilder {
     private final NodeStateBuilderContext context;
 
     private String path;
 
-    private KernelNodeStateBuilder2(NodeStateBuilderContext context, String path) {
+    private KernelNodeStateBuilder(NodeStateBuilderContext context, String path) {
         this.context = context;
         this.path = path;
     }
 
     public static NodeStateBuilder create(NodeStateBuilderContext context) {
-        return new KernelNodeStateBuilder2(context, "");
+        return new KernelNodeStateBuilder(context, "");
     }
 
 
@@ -32,7 +32,7 @@ public class KernelNodeStateBuilder2 imp
     @Override
     public NodeStateBuilder getChildBuilder(String name) {
         return hasChild(name)
-            ? new KernelNodeStateBuilder2(context, PathUtils.concat(path, name))
+            ? new KernelNodeStateBuilder(context, PathUtils.concat(path, name))
             : null;
     }
 
@@ -44,7 +44,7 @@ public class KernelNodeStateBuilder2 imp
         else {
             String targetPath = PathUtils.concat(path, name);
             context.addNode(nodeState, targetPath);
-            return new KernelNodeStateBuilder2(context, targetPath);
+            return new KernelNodeStateBuilder(context, targetPath);
         }
     }
 
@@ -56,7 +56,7 @@ public class KernelNodeStateBuilder2 imp
         else {
             String targetPath = PathUtils.concat(path, name);
             context.addNode(targetPath);
-            return new KernelNodeStateBuilder2(context, targetPath);
+            return new KernelNodeStateBuilder(context, targetPath);
         }
     }
 
@@ -102,7 +102,7 @@ public class KernelNodeStateBuilder2 imp
 
     @Override
     public boolean moveTo(NodeStateBuilder destParent, String destName) {
-        if (!(destParent instanceof KernelNodeStateBuilder2)) {
+        if (!(destParent instanceof KernelNodeStateBuilder)) {
             throw new IllegalArgumentException("Alien builder for destParent");
         }
 
@@ -110,7 +110,7 @@ public class KernelNodeStateBuilder2 imp
             return false;
         }
 
-        KernelNodeStateBuilder2 destParentBuilder = (KernelNodeStateBuilder2) destParent;
+        KernelNodeStateBuilder destParentBuilder = (KernelNodeStateBuilder) destParent;
         String destPath = PathUtils.concat(destParentBuilder.path, destName);
 
         context.moveNode(path, destPath);
@@ -120,7 +120,7 @@ public class KernelNodeStateBuilder2 imp
 
     @Override
     public boolean copyTo(NodeStateBuilder destParent, String destName) {
-        if (!(destParent instanceof KernelNodeStateBuilder2)) {
+        if (!(destParent instanceof KernelNodeStateBuilder)) {
             throw new IllegalArgumentException("Alien builder for destParent");
         }
 
@@ -128,7 +128,7 @@ public class KernelNodeStateBuilder2 imp
             return false;
         }
 
-        KernelNodeStateBuilder2 destParentBuilder = (KernelNodeStateBuilder2) destParent;
+        KernelNodeStateBuilder destParentBuilder = (KernelNodeStateBuilder) destParent;
         String destPath = PathUtils.concat(destParentBuilder.path, destName);
 
         context.copyNode(path, destPath);

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
(from r1333010, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore2.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore2.java&r1=1333010&r2=1333014&rev=1333014&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore2.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
Wed May  2 12:32:52 2012
@@ -18,7 +18,7 @@ import org.apache.jackrabbit.oak.util.Pr
 
 import java.util.Iterator;
 
-public class KernelNodeStore2 extends AbstractNodeStore {
+public class KernelNodeStore extends AbstractNodeStore {
     /**
      * The {@link org.apache.jackrabbit.mk.api.MicroKernel} instance used to store the content
tree.
      */
@@ -34,7 +34,7 @@ public class KernelNodeStore2 extends Ab
      */
     private KernelNodeState root;
 
-    public KernelNodeStore2(MicroKernel kernel) {
+    public KernelNodeStore(MicroKernel kernel) {
         this.kernel = kernel;
         this.valueFactory = new CoreValueFactoryImpl(kernel);
         this.root = new KernelNodeState(
@@ -61,16 +61,16 @@ public class KernelNodeStore2 extends Ab
         String branchRevision = kernel.branch(kernelNodeState.getRevision());
         String path = kernelNodeState.getPath();
         KernelNodeState branchRoot = new KernelNodeState(kernel, valueFactory, path, branchRevision);
-        return KernelNodeStateBuilder2.create(new NodeStateBuilderContext(branchRoot));
+        return KernelNodeStateBuilder.create(new NodeStateBuilderContext(branchRoot));
     }
 
     @Override
     public void apply(NodeStateBuilder builder) throws CommitFailedException {
-        if (!(builder instanceof  KernelNodeStateBuilder2)) {
+        if (!(builder instanceof KernelNodeStateBuilder)) {
             throw new IllegalArgumentException("Alien builder");
         }
 
-        KernelNodeStateBuilder2 kernelNodeStateBuilder = (KernelNodeStateBuilder2) builder;
+        KernelNodeStateBuilder kernelNodeStateBuilder = (KernelNodeStateBuilder) builder;
         kernelNodeStateBuilder.getContext().applyPendingChanges();
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/AbstractOakTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/AbstractOakTest.java?rev=1333014&r1=1333013&r2=1333014&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/AbstractOakTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/AbstractOakTest.java
Wed May  2 12:32:52 2012
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.oak.core;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
-import org.apache.jackrabbit.oak.kernel.KernelNodeStore2;
+import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.junit.Before;
@@ -45,7 +45,7 @@ public abstract class AbstractOakTest {
     @Before
     public void setUp() {
         MicroKernel microKernel = new MicroKernelImpl();
-        store = new KernelNodeStore2(microKernel);
+        store = new KernelNodeStore(microKernel);
         valueFactory = store.getValueFactory();
 
         state = createInitialState(microKernel);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java?rev=1333014&r1=1333013&r2=1333014&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplFuzzIT.java
Wed May  2 12:32:52 2012
@@ -26,7 +26,7 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.core.RootImplFuzzIT.Operation.Rebase;
-import org.apache.jackrabbit.oak.kernel.KernelNodeStore2;
+import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
 import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -56,10 +56,10 @@ public class RootImplFuzzIT {
 
     private final Random random;
 
-    private KernelNodeStore2 store1;
+    private KernelNodeStore store1;
     private RootImpl root1;
 
-    private KernelNodeStore2 store2;
+    private KernelNodeStore store2;
     private RootImpl root2;
 
     private int counter;
@@ -78,13 +78,13 @@ public class RootImplFuzzIT {
         counter = 0;
 
         MicroKernel mk1 = new MicroKernelImpl("./target/mk1/" + random.nextInt());
-        store1 = new KernelNodeStore2(mk1);
+        store1 = new KernelNodeStore(mk1);
         vf = store1.getValueFactory();
         mk1.commit("", "+\"/test\":{} +\"/test/root\":{}", mk1.getHeadRevision(), "");
         root1 = new RootImpl(store1, "test");
 
         MicroKernel mk2 = new MicroKernelImpl("./target/mk2/" + random.nextInt());
-        store2 = new KernelNodeStore2(mk2);
+        store2 = new KernelNodeStore(mk2);
         mk2.commit("", "+\"/test\":{} +\"/test/root\":{}", mk2.getHeadRevision(), "");
         root2 = new RootImpl(store2, "test");
     }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java?rev=1333014&r1=1333013&r2=1333014&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
Wed May  2 12:32:52 2012
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.oak.query;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
-import org.apache.jackrabbit.oak.kernel.KernelNodeStore2;
+import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 
 /**
@@ -30,7 +30,7 @@ public abstract class AbstractQueryTest 
     // TODO improve: use ContentRepository here instead of creating mk instance.
     protected final MicroKernel mk = new MicroKernelImpl();
 
-    protected final NodeStore store = new KernelNodeStore2(mk);
+    protected final NodeStore store = new KernelNodeStore(mk);
 
     protected final CoreValueFactory vf = store.getValueFactory();
 



Mime
View raw message