jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1525524 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: kernel/KernelNodeStore.java kernel/KernelRootBuilder.java plugins/memory/MemoryNodeStore.java spi/state/AbstractNodeStore.java
Date Mon, 23 Sep 2013 08:06:09 GMT
Author: mduerig
Date: Mon Sep 23 08:06:09 2013
New Revision: 1525524

URL: http://svn.apache.org/r1525524
Log:
OAK-659 Move purge logic for transient changes below the NodeBuilder interface
Consolidate branching methods

Modified:
    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/KernelRootBuilder.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/AbstractNodeStore.java

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=1525524&r1=1525523&r2=1525524&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
Mon Sep 23 08:06:09 2013
@@ -209,8 +209,8 @@ public class KernelNodeStore extends Abs
     }
 
     @Override
-    protected NodeStoreBranch branch() {
-        return new KernelNodeStoreBranch(this, mergeLock, getRoot());
+    protected NodeStoreBranch createBranch(NodeState base) {
+        return new KernelNodeStoreBranch(this, mergeLock, (KernelNodeState) base);
     }
 
     /**
@@ -260,10 +260,6 @@ public class KernelNodeStore extends Abs
         return kernel;
     }
 
-    NodeStoreBranch createBranch(KernelNodeState base) {
-        return new KernelNodeStoreBranch(this, mergeLock, base);
-    }
-
     KernelNodeState commit(String jsop, KernelNodeState base) {
         KernelNodeState rootState = getRootState(kernel.commit("", jsop, base.getRevision(),
null));
         if (base.isBranch()) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRootBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRootBuilder.java?rev=1525524&r1=1525523&r2=1525524&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRootBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRootBuilder.java
Mon Sep 23 08:06:09 2013
@@ -123,7 +123,7 @@ class KernelRootBuilder extends MemoryNo
      * state of that branch as the new base state of this builder.
      */
     NodeState reset() {
-        branch = store.branch();
+        branch = store.createBranch(store.getRoot());
         NodeState head = branch.getHead();
         reset(head);
         return head;

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=1525524&r1=1525523&r2=1525524&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
Mon Sep 23 08:06:09 2013
@@ -66,8 +66,8 @@ public class MemoryNodeStore extends Abs
     }
 
     @Override
-    protected NodeStoreBranch branch() {
-        return new MemoryNodeStoreBranch(this, root.get());
+    protected NodeStoreBranch createBranch(NodeState base) {
+        return new MemoryNodeStoreBranch(this, base);
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStore.java?rev=1525524&r1=1525523&r2=1525524&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStore.java
Mon Sep 23 08:06:09 2013
@@ -47,7 +47,7 @@ public abstract class AbstractNodeStore 
      * @return branch
      */
     @Nonnull
-    protected abstract NodeStoreBranch branch();
+    protected abstract NodeStoreBranch createBranch(NodeState base);
 
     /**
      * This default implementation is equal to first rebasing the builder
@@ -68,7 +68,7 @@ public abstract class AbstractNodeStore 
             PostCommitHook committed) throws CommitFailedException {
         checkNotNull(commitHook);
         rebase(checkNotNull(builder));
-        NodeStoreBranch branch = branch();
+        NodeStoreBranch branch = createBranch(getRoot());
         branch.setRoot(builder.getNodeState());
         NodeState merged = branch.merge(commitHook, committed);
         reset(builder, merged);



Mime
View raw message