jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1365978 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/core/ main/java/org/apache/jackrabbit/oak/kernel/ main/java/org/apache/jackrabbit/oak/plugins/lucene/ main/java/org/apache/jackrabbit/oak/plugins/memory/ ...
Date Thu, 26 Jul 2012 13:19:56 GMT
Author: jukka
Date: Thu Jul 26 13:19:55 2012
New Revision: 1365978

URL: http://svn.apache.org/viewvc?rev=1365978&view=rev
Log:
OAK-167: Caching NodeStore implementation

Rename NodeStateBuilder to NodeBuilder for brevity and simplicity

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
  (contents, props changed)
      - copied, changed from r1365977, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStateBuilder.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeBuilder.java
  (contents, props changed)
      - copied, changed from r1365977, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
  (contents, props changed)
      - copied, changed from r1365977, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStateBuilderTest.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStateBuilder.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStateBuilderTest.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRootStateBuilder.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/OakDirectory.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStore.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java?rev=1365978&r1=1365977&r2=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
Thu Jul 26 13:19:55 2012
@@ -29,7 +29,7 @@ import org.apache.jackrabbit.oak.api.Con
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStateBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
@@ -69,7 +69,7 @@ public class RootImpl implements Root {
      * notifications are required, they need to explicitly re-register.
      *
      * The {@link TreeImpl} instances us this mechanism to dispose of its associated
-     * {@link NodeStateBuilder} on purge. Keeping a reference on those {@code TreeImpl}
+     * {@link NodeBuilder} on purge. Keeping a reference on those {@code TreeImpl}
      * instances {@code NodeStateBuilder} (i.e. those which are modified) prevents them
      * from being prematurely garbage collected.
      */
@@ -185,7 +185,7 @@ public class RootImpl implements Root {
         return branch.getBase();
     }
 
-    NodeStateBuilder createRootBuilder() {
+    NodeBuilder createRootBuilder() {
         return store.getBuilder(branch.getRoot());
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java?rev=1365978&r1=1365977&r2=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
Thu Jul 26 13:19:55 2012
@@ -33,7 +33,7 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.core.RootImpl.PurgeListener;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStateBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
 
 import com.google.common.base.Function;
@@ -54,7 +54,7 @@ public class TreeImpl implements Tree, P
     private String name;
 
     /** Lazily initialised {@code NodeStateBuilder} for the underlying node state */
-    NodeStateBuilder nodeStateBuilder;
+    NodeBuilder nodeBuilder;
 
     /**
      * Cache for child trees that have been accessed before.
@@ -79,12 +79,12 @@ public class TreeImpl implements Tree, P
             }
 
             @Override
-            protected synchronized NodeStateBuilder getNodeStateBuilder() {
-                if (nodeStateBuilder == null) {
-                    nodeStateBuilder = root.createRootBuilder();
+            protected synchronized NodeBuilder getNodeBuilder() {
+                if (nodeBuilder == null) {
+                    nodeBuilder = root.createRootBuilder();
                     root.addListener(this);
                 }
-                return nodeStateBuilder;
+                return nodeBuilder;
             }
         };
     }
@@ -118,7 +118,7 @@ public class TreeImpl implements Tree, P
 
     @Override
     public PropertyState getProperty(String name) {
-        return getNodeStateBuilder().getProperty(name);
+        return getNodeBuilder().getProperty(name);
     }
 
     @Override
@@ -171,12 +171,12 @@ public class TreeImpl implements Tree, P
 
     @Override
     public long getPropertyCount() {
-        return getNodeStateBuilder().getPropertyCount();
+        return getNodeBuilder().getPropertyCount();
     }
 
     @Override
     public Iterable<? extends PropertyState> getProperties() {
-        return getNodeStateBuilder().getProperties();
+        return getNodeBuilder().getProperties();
     }
 
     @Override
@@ -219,18 +219,18 @@ public class TreeImpl implements Tree, P
 
     @Override
     public boolean hasChild(String name) {
-        return getNodeStateBuilder().hasChildNode(name);
+        return getNodeBuilder().hasChildNode(name);
     }
 
     @Override
     public long getChildrenCount() {
-        return getNodeStateBuilder().getChildNodeCount();
+        return getNodeBuilder().getChildNodeCount();
     }
 
     @Override
     public Iterable<Tree> getChildren() {
         return Iterables.transform(
-                getNodeStateBuilder().getChildNodeNames(),
+                getNodeBuilder().getChildNodeNames(),
                 new Function<String, Tree>() {
                     @Override
                     public Tree apply(String input) {
@@ -247,7 +247,7 @@ public class TreeImpl implements Tree, P
     @Override
     public Tree addChild(String name) {
         if (!hasChild(name)) {
-            NodeStateBuilder builder = getNodeStateBuilder();
+            NodeBuilder builder = getNodeBuilder();
             builder.setNode(name, EMPTY_NODE);
             root.purge();
         }
@@ -264,7 +264,7 @@ public class TreeImpl implements Tree, P
         }
 
         if (!isRoot() && parent.hasChild(name)) {
-            NodeStateBuilder builder = parent.getNodeStateBuilder();
+            NodeBuilder builder = parent.getNodeBuilder();
             builder.removeNode(name);
             parent.children.remove(name);
             parent = this;
@@ -277,7 +277,7 @@ public class TreeImpl implements Tree, P
 
     @Override
     public PropertyState setProperty(String name, CoreValue value) {
-        NodeStateBuilder builder = getNodeStateBuilder();
+        NodeBuilder builder = getNodeBuilder();
         builder.setProperty(name, value);
         root.purge();
         PropertyState property = getProperty(name);
@@ -287,7 +287,7 @@ public class TreeImpl implements Tree, P
 
     @Override
     public PropertyState setProperty(String name, List<CoreValue> values) {
-        NodeStateBuilder builder = getNodeStateBuilder();
+        NodeBuilder builder = getNodeBuilder();
         builder.setProperty(name, values);
         root.purge();
         PropertyState property = getProperty(name);
@@ -297,7 +297,7 @@ public class TreeImpl implements Tree, P
 
     @Override
     public void removeProperty(String name) {
-        NodeStateBuilder builder = getNodeStateBuilder();
+        NodeBuilder builder = getNodeBuilder();
         builder.removeProperty(name);
         root.purge();
     }
@@ -306,7 +306,7 @@ public class TreeImpl implements Tree, P
 
     @Override
     public void purged() {
-        nodeStateBuilder = null;
+        nodeBuilder = null;
     }
 
     //----------------------------------------------------------< protected >---
@@ -324,16 +324,16 @@ public class TreeImpl implements Tree, P
     }
 
     @Nonnull
-    protected synchronized NodeStateBuilder getNodeStateBuilder() {
+    protected synchronized NodeBuilder getNodeBuilder() {
         if (isRemoved()) {
             throw new IllegalStateException("Cannot get a builder for a removed tree");
         }
 
-        if (nodeStateBuilder == null) {
-            nodeStateBuilder = parent.getNodeStateBuilder().getChildBuilder(name);
+        if (nodeBuilder == null) {
+            nodeBuilder = parent.getNodeBuilder().getChildBuilder(name);
             root.addListener(this);
         }
-        return nodeStateBuilder;
+        return nodeBuilder;
     }
 
     //-----------------------------------------------------------< internal >---
@@ -359,7 +359,7 @@ public class TreeImpl implements Tree, P
 
     @Nonnull
     NodeState getNodeState() {
-        return getNodeStateBuilder().getNodeState();
+        return getNodeBuilder().getNodeState();
     }
 
     //------------------------------------------------------------< private >---

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java?rev=1365978&r1=1365977&r2=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
Thu Jul 26 13:19:55 2012
@@ -18,15 +18,15 @@ package org.apache.jackrabbit.oak.kernel
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
-import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStateBuilder;
+import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
-class KernelNodeStateBuilder extends MemoryNodeStateBuilder {
+class KernelNodeStateBuilder extends MemoryNodeBuilder {
 
     private final KernelRootStateBuilder root;
 
     public KernelNodeStateBuilder(
-            MemoryNodeStateBuilder parent, String name,
+            MemoryNodeBuilder parent, String name,
             NodeState base, KernelRootStateBuilder root) {
         super(parent, name, base);
         this.root = checkNotNull(root);
@@ -35,7 +35,7 @@ class KernelNodeStateBuilder extends Mem
     //--------------------------------------------< MemoryNodeStateBuilder >--
 
     @Override
-    protected MemoryNodeStateBuilder createChildBuilder(
+    protected MemoryNodeBuilder createChildBuilder(
             String name, NodeState child) {
         return new KernelNodeStateBuilder(this, name, child, root);
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java?rev=1365978&r1=1365977&r2=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
Thu Jul 26 13:19:55 2012
@@ -20,13 +20,13 @@ import javax.annotation.Nonnull;
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
-import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStateBuilder;
+import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeBuilder;
 import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
 import org.apache.jackrabbit.oak.spi.commit.EmptyEditor;
 import org.apache.jackrabbit.oak.spi.commit.EmptyObserver;
 import org.apache.jackrabbit.oak.spi.commit.Observer;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStateBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
 
@@ -102,14 +102,14 @@ public class KernelNodeStore implements 
     }
 
     @Override
-    public NodeStateBuilder getBuilder(NodeState base) {
+    public NodeBuilder getBuilder(NodeState base) {
         if (base instanceof KernelNodeState) {
             KernelNodeState kbase = (KernelNodeState) base;
             if ("/".equals(kbase.getPath())) {
                 return new KernelRootStateBuilder(kernel, kbase.getRevision());
             }
         }
-        return new MemoryNodeStateBuilder(base);
+        return new MemoryNodeBuilder(base);
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRootStateBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRootStateBuilder.java?rev=1365978&r1=1365977&r2=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRootStateBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRootStateBuilder.java
Thu Jul 26 13:19:55 2012
@@ -23,13 +23,13 @@ import java.util.Set;
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.json.JsopBuilder;
-import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStateBuilder;
+import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 
-class KernelRootStateBuilder extends MemoryNodeStateBuilder {
+class KernelRootStateBuilder extends MemoryNodeBuilder {
 
     /**
      * Number of content updates that need to happen before the updates
@@ -55,7 +55,7 @@ class KernelRootStateBuilder extends Mem
     //--------------------------------------------< MemoryNodeStateBuilder >--
 
     @Override
-    protected MemoryNodeStateBuilder createChildBuilder(
+    protected MemoryNodeBuilder createChildBuilder(
             String name, NodeState child) {
         return new KernelNodeStateBuilder(this, name, child, this);
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/OakDirectory.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/OakDirectory.java?rev=1365978&r1=1365977&r2=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/OakDirectory.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/OakDirectory.java
Thu Jul 26 13:19:55 2012
@@ -27,7 +27,7 @@ import org.apache.jackrabbit.oak.api.Cor
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStateBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
@@ -45,16 +45,16 @@ class OakDirectory extends Directory {
 
     private final CoreValueFactory factory;
 
-    private final NodeStateBuilder rootBuilder;
+    private final NodeBuilder rootBuilder;
 
-    private final NodeStateBuilder directoryBuilder;
+    private final NodeBuilder directoryBuilder;
 
     public OakDirectory(NodeStore store, NodeState root, String... path) {
         this.lockFactory = NoLockFactory.getNoLockFactory();
         this.factory = store.getValueFactory();
         this.rootBuilder = store.getBuilder(root);
 
-        NodeStateBuilder builder = rootBuilder;
+        NodeBuilder builder = rootBuilder;
         for (String name : path) {
             builder = builder.getChildBuilder(name);
         }
@@ -88,7 +88,7 @@ class OakDirectory extends Directory {
             return 0;
         }
 
-        NodeStateBuilder fileBuilder = directoryBuilder.getChildBuilder(name);
+        NodeBuilder fileBuilder = directoryBuilder.getChildBuilder(name);
         PropertyState property = fileBuilder.getProperty("jcr:data");
         if (property == null || property.isArray()) {
             return 0;
@@ -125,7 +125,7 @@ class OakDirectory extends Directory {
             return new byte[0];
         }
 
-        NodeStateBuilder fileBuilder = directoryBuilder.getChildBuilder(name);
+        NodeBuilder fileBuilder = directoryBuilder.getChildBuilder(name);
         PropertyState property = fileBuilder.getProperty("jcr:data");
         if (property == null || property.isArray()) {
             return new byte[0];
@@ -216,7 +216,7 @@ class OakDirectory extends Directory {
                 System.arraycopy(buffer, 0, data, 0, size);
             }
 
-            NodeStateBuilder fileBuilder =
+            NodeBuilder fileBuilder =
                     directoryBuilder.getChildBuilder(name);
             fileBuilder.setProperty(
                     "jcr:lastModified",

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
(from r1365977, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStateBuilder.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStateBuilder.java&r1=1365977&r2=1365978&rev=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStateBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
Thu Jul 26 13:19:55 2012
@@ -28,7 +28,7 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.spi.state.AbstractNodeState;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStateBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
 
 import com.google.common.base.Predicate;
@@ -68,7 +68,7 @@ import com.google.common.collect.Maps;
  *   </dd>
  * </dl>
  */
-public class MemoryNodeStateBuilder implements NodeStateBuilder {
+public class MemoryNodeBuilder implements NodeBuilder {
 
     private static final NodeState NULL_STATE = new MemoryNodeState(
             ImmutableMap.<String, PropertyState>of(),
@@ -78,7 +78,7 @@ public class MemoryNodeStateBuilder impl
      * Parent state builder reference, or {@code null} once this builder
      * has been connected.
      */
-    private MemoryNodeStateBuilder parent;
+    private MemoryNodeBuilder parent;
 
     /**
      * Name of this child node within the parent builder, or {@code null}
@@ -106,8 +106,8 @@ public class MemoryNodeStateBuilder impl
      * @param name name of this node
      * @param base base state of this node
      */
-    protected MemoryNodeStateBuilder(
-            MemoryNodeStateBuilder parent, String name, NodeState base) {
+    protected MemoryNodeBuilder(
+            MemoryNodeBuilder parent, String name, NodeState base) {
         this.parent = checkNotNull(parent);
         this.name = checkNotNull(name);
         this.readState = checkNotNull(base);
@@ -119,7 +119,7 @@ public class MemoryNodeStateBuilder impl
      *
      * @param base base state of the new builder
      */
-    public MemoryNodeStateBuilder(NodeState base) {
+    public MemoryNodeBuilder(NodeState base) {
         this.parent = null;
         this.name = null;
         MutableNodeState mstate = new MutableNodeState(checkNotNull(base));
@@ -181,9 +181,9 @@ public class MemoryNodeStateBuilder impl
      * @param child base state of the new builder, or {@code null}
      * @return new builder
      */
-    protected MemoryNodeStateBuilder createChildBuilder(
+    protected MemoryNodeBuilder createChildBuilder(
             String name, NodeState child) {
-        return new MemoryNodeStateBuilder(this, name, child);
+        return new MemoryNodeBuilder(this, name, child);
     }
 
     /**
@@ -311,7 +311,7 @@ public class MemoryNodeStateBuilder impl
     }
 
     @Override
-    public NodeStateBuilder getChildBuilder(String name) {
+    public NodeBuilder getChildBuilder(String name) {
         NodeState state = read();
 
         if (writeState == null) {
@@ -331,7 +331,7 @@ public class MemoryNodeStateBuilder impl
             return createChildBuilder(name, mstate.base.getChildNode(name));
         }
 
-        MemoryNodeStateBuilder builder = createChildBuilder(name, cbase);
+        MemoryNodeBuilder builder = createChildBuilder(name, cbase);
         builder.write();
         return builder;
     }

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStore.java?rev=1365978&r1=1365977&r2=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStore.java
Thu Jul 26 13:19:55 2012
@@ -21,7 +21,7 @@ import java.util.concurrent.atomic.Atomi
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStateBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
 
@@ -40,8 +40,8 @@ public class MemoryNodeStore implements 
     }
 
     @Override
-    public NodeStateBuilder getBuilder(NodeState base) {
-        return new MemoryNodeStateBuilder(base);
+    public NodeBuilder getBuilder(NodeState base) {
+        return new MemoryNodeBuilder(base);
     }
 
     @Override

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeBuilder.java
(from r1365977, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeBuilder.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeBuilder.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder.java&r1=1365977&r2=1365978&rev=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeBuilder.java
Thu Jul 26 13:19:55 2012
@@ -26,7 +26,7 @@ import org.apache.jackrabbit.oak.api.Pro
 /**
  * Builder interface for constructing new {@link NodeState node states}.
  */
-public interface NodeStateBuilder {
+public interface NodeBuilder {
 
     /**
      * Returns an immutable node state that matches the current state of
@@ -141,6 +141,6 @@ public interface NodeStateBuilder {
      * @return child builder
      */
     @Nonnull
-    NodeStateBuilder getChildBuilder(String name);
+    NodeBuilder getChildBuilder(String name);
 
 }

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStore.java?rev=1365978&r1=1365977&r2=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStore.java
Thu Jul 26 13:19:55 2012
@@ -55,7 +55,7 @@ public interface NodeStore {
      * @return  builder instance
      */
     @Nonnull
-    NodeStateBuilder getBuilder(NodeState base);
+    NodeBuilder getBuilder(NodeState base);
 
     /**
      * Returns the factory for creating values used for building node states.

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java?rev=1365978&r1=1365977&r2=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java
Thu Jul 26 13:19:55 2012
@@ -26,7 +26,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
 import org.apache.jackrabbit.oak.spi.commit.Observer;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStateBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
 import org.junit.Before;
@@ -71,9 +71,9 @@ public class KernelNodeStoreTest {
     public void branch() throws CommitFailedException {
         NodeStoreBranch branch = store.branch();
 
-        NodeStateBuilder rootBuilder = store.getBuilder(branch.getRoot());
-        NodeStateBuilder testBuilder = rootBuilder.getChildBuilder("test");
-        NodeStateBuilder newNodeBuilder = testBuilder.getChildBuilder("newNode");
+        NodeBuilder rootBuilder = store.getBuilder(branch.getRoot());
+        NodeBuilder testBuilder = rootBuilder.getChildBuilder("test");
+        NodeBuilder newNodeBuilder = testBuilder.getChildBuilder("newNode");
 
         testBuilder.removeNode("x");
 
@@ -126,9 +126,9 @@ public class KernelNodeStoreTest {
         });
 
         NodeState root = store.getRoot();
-        NodeStateBuilder rootBuilder= store.getBuilder(root);
-        NodeStateBuilder testBuilder = rootBuilder.getChildBuilder("test");
-        NodeStateBuilder newNodeBuilder = testBuilder.getChildBuilder("newNode");
+        NodeBuilder rootBuilder= store.getBuilder(root);
+        NodeBuilder testBuilder = rootBuilder.getChildBuilder("test");
+        NodeBuilder newNodeBuilder = testBuilder.getChildBuilder("newNode");
 
         CoreValue fortyTwo = store.getValueFactory().createValue(42);
         newNodeBuilder.setProperty("n", fortyTwo);
@@ -160,8 +160,8 @@ public class KernelNodeStoreTest {
             @Override
             public NodeState editCommit(
                     NodeStore store, NodeState before, NodeState after) {
-                NodeStateBuilder rootBuilder = store.getBuilder(after);
-                NodeStateBuilder testBuilder = store.getBuilder(after.getChildNode("test"));
+                NodeBuilder rootBuilder = store.getBuilder(after);
+                NodeBuilder testBuilder = store.getBuilder(after.getChildNode("test"));
                 testBuilder.setNode("fromHook", MemoryNodeState.EMPTY_NODE);
                 rootBuilder.setNode("test", testBuilder.getNodeState());
                 return rootBuilder.getNodeState();
@@ -169,9 +169,9 @@ public class KernelNodeStoreTest {
         });
 
         NodeState root = store.getRoot();
-        NodeStateBuilder rootBuilder = store.getBuilder(root);
-        NodeStateBuilder testBuilder = rootBuilder.getChildBuilder("test");
-        NodeStateBuilder newNodeBuilder = testBuilder.getChildBuilder("newNode");
+        NodeBuilder rootBuilder = store.getBuilder(root);
+        NodeBuilder testBuilder = rootBuilder.getChildBuilder("test");
+        NodeBuilder newNodeBuilder = testBuilder.getChildBuilder("newNode");
 
         final CoreValue fortyTwo = store.getValueFactory().createValue(42);
         newNodeBuilder.setProperty("n", fortyTwo);

Copied: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
(from r1365977, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStateBuilderTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java?p2=jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java&p1=jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStateBuilderTest.java&r1=1365977&r2=1365978&rev=1365978&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStateBuilderTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
Thu Jul 26 13:19:55 2012
@@ -25,12 +25,12 @@ import static junit.framework.Assert.fai
 
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStateBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.junit.Test;
 
 import com.google.common.collect.ImmutableMap;
 
-public class MemoryNodeStateBuilderTest {
+public class MemoryNodeBuilderTest {
 
     private static final NodeState BASE = new MemoryNodeState(
             ImmutableMap.<String, PropertyState>of(
@@ -44,9 +44,9 @@ public class MemoryNodeStateBuilderTest 
 
     @Test
     public void testConnectOnAddProperty() {
-        NodeStateBuilder root = new MemoryNodeStateBuilder(BASE);
-        NodeStateBuilder childA = root.getChildBuilder("x");
-        NodeStateBuilder childB = root.getChildBuilder("x");
+        NodeBuilder root = new MemoryNodeBuilder(BASE);
+        NodeBuilder childA = root.getChildBuilder("x");
+        NodeBuilder childB = root.getChildBuilder("x");
 
         assertNull(childA.getProperty("test"));
         childB.setProperty("test", new StringValue("foo"));
@@ -55,9 +55,9 @@ public class MemoryNodeStateBuilderTest 
 
     @Test
     public void testConnectOnUpdateProperty() {
-        NodeStateBuilder root = new MemoryNodeStateBuilder(BASE);
-        NodeStateBuilder childA = root.getChildBuilder("x");
-        NodeStateBuilder childB = root.getChildBuilder("x");
+        NodeBuilder root = new MemoryNodeBuilder(BASE);
+        NodeBuilder childA = root.getChildBuilder("x");
+        NodeBuilder childB = root.getChildBuilder("x");
 
         childB.setProperty("test", new StringValue("foo"));
         childA.setProperty("test", new StringValue("bar"));
@@ -68,9 +68,9 @@ public class MemoryNodeStateBuilderTest 
 
     @Test
     public void testConnectOnRemoveProperty() {
-        NodeStateBuilder root = new MemoryNodeStateBuilder(BASE);
-        NodeStateBuilder childA = root.getChildBuilder("x");
-        NodeStateBuilder childB = root.getChildBuilder("x");
+        NodeBuilder root = new MemoryNodeBuilder(BASE);
+        NodeBuilder childA = root.getChildBuilder("x");
+        NodeBuilder childB = root.getChildBuilder("x");
 
         childB.setProperty("test", new StringValue("foo"));
         childA.removeProperty("test");
@@ -79,9 +79,9 @@ public class MemoryNodeStateBuilderTest 
 
     @Test
     public void testConnectOnAddNode() {
-        NodeStateBuilder root = new MemoryNodeStateBuilder(BASE);
-        NodeStateBuilder childA = root.getChildBuilder("x");
-        NodeStateBuilder childB = root.getChildBuilder("x");
+        NodeBuilder root = new MemoryNodeBuilder(BASE);
+        NodeBuilder childA = root.getChildBuilder("x");
+        NodeBuilder childB = root.getChildBuilder("x");
 
         assertFalse(childA.hasChildNode("test"));
         childB.setNode("test", MemoryNodeState.EMPTY_NODE);
@@ -90,8 +90,8 @@ public class MemoryNodeStateBuilderTest 
 
     @Test(expected = IllegalStateException.class)
     public void testConnectOnRemoveNode() {
-        NodeStateBuilder root = new MemoryNodeStateBuilder(BASE);
-        NodeStateBuilder child = root.getChildBuilder("x");
+        NodeBuilder root = new MemoryNodeBuilder(BASE);
+        NodeBuilder child = root.getChildBuilder("x");
 
         root.removeNode("x");
         child.getChildNodeCount(); // should throw ISE

Propchange: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message