jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1533020 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/ oak-core/src/main/java/org/...
Date Thu, 17 Oct 2013 09:28:16 GMT
Author: mduerig
Date: Thu Oct 17 09:28:15 2013
New Revision: 1533020

URL: http://svn.apache.org/r1533020
Log:
OAK-144 Implement observation
Pass CommitInfo to merge methods instead of round tripping it through the commit info node on the persistence layer.

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitInfo.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/CommitInfoEditorProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ObservationConstants.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractTree.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.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/KernelNodeStoreBranch.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/index/AsyncIndexUpdate.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/plugins/mongomk/MongoNodeStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeDispatcher.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreBranch.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreService.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/lifecycle/OakInitializer.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStoreBranch.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeBuilderTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreCacheTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/NodeStoreTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndexTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/JournalTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/MergeTest.java
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java Thu Oct 17 09:28:15 2013
@@ -36,6 +36,7 @@ import com.google.common.collect.Lists;
 import org.apache.jackrabbit.oak.api.Blob;
 import org.apache.jackrabbit.oak.api.BlobFactory;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
+import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.QueryEngine;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.commons.PathUtils;
@@ -43,6 +44,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.query.ExecutionContext;
 import org.apache.jackrabbit.oak.query.QueryEngineImpl;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.CompositeEditorProvider;
 import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
 import org.apache.jackrabbit.oak.spi.commit.EditorHook;
@@ -240,7 +242,12 @@ public abstract class AbstractRoot imple
     @Override
     public void commit(final CommitHook... hooks) throws CommitFailedException {
         checkLive();
-        base = store.merge(builder, getCommitHook(hooks));
+        ContentSession session = getContentSession();
+        CommitInfo info = CommitInfo.create(
+                session.toString(),
+                session.getAuthInfo().getUserID(),
+                System.currentTimeMillis());
+        base = store.merge(builder, getCommitHook(hooks), info);
         secureBuilder.baseChanged();
         modCount = 0;
         if (permissionProvider.hasValue()) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractTree.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractTree.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractTree.java Thu Oct 17 09:28:15 2013
@@ -39,7 +39,6 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.plugins.index.IndexConstants;
-import org.apache.jackrabbit.oak.plugins.observation.CommitInfoEditorProvider;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
@@ -59,7 +58,7 @@ public abstract class AbstractTree imple
     // TODO: make this configurable
     private static final String[] INTERNAL_NODE_NAMES = {
             IndexConstants.INDEX_CONTENT_NODE_NAME,
-            MicroKernel.CONFLICT_NAME, CommitInfoEditorProvider.COMMIT_INFO};
+            MicroKernel.CONFLICT_NAME};
 
     /**
      * Name of this tree

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java Thu Oct 17 09:28:15 2013
@@ -30,11 +30,8 @@ import org.apache.jackrabbit.oak.api.Aut
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.plugins.observation.ChangeDispatcher.Listener;
-import org.apache.jackrabbit.oak.plugins.observation.CommitInfoEditorProvider;
 import org.apache.jackrabbit.oak.plugins.observation.Observable;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
-import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
-import org.apache.jackrabbit.oak.spi.commit.EditorHook;
 import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
 import org.apache.jackrabbit.oak.spi.security.SecurityProvider;
 import org.apache.jackrabbit.oak.spi.security.authentication.LoginContext;
@@ -106,12 +103,8 @@ class ContentSessionImpl implements Cont
     @Override
     public Root getLatestRoot() {
         checkLive();
-
-        EditorHook commitInfoEditor = new EditorHook(
-                new CommitInfoEditorProvider(sessionName, getAuthInfo().getUserID()));
-
-        return new AbstractRoot(store, new CompositeHook(hook, commitInfoEditor),
-                workspaceName, loginContext.getSubject(), securityProvider, indexProvider) {
+        return new AbstractRoot(store, hook, workspaceName, loginContext.getSubject(),
+                securityProvider, indexProvider) {
             @Override
             protected void checkLive() {
                 ContentSessionImpl.this.checkLive();

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=1533020&r1=1533019&r2=1533020&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 Oct 17 09:28:15 2013
@@ -16,11 +16,15 @@
  */
 package org.apache.jackrabbit.oak.kernel;
 
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
+
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 
@@ -38,6 +42,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.observation.ChangeDispatcher.Listener;
 import org.apache.jackrabbit.oak.plugins.observation.Observable;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EmptyObserver;
 import org.apache.jackrabbit.oak.spi.commit.Observer;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -45,9 +50,6 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
 
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
 /**
  * {@code NodeStore} implementations against {@link MicroKernel}.
  */
@@ -163,15 +165,15 @@ public class KernelNodeStore implements 
     }
 
     /**
-     * This implementation delegates to {@link KernelRootBuilder#merge(CommitHook)}
+     * This implementation delegates to {@link KernelRootBuilder#merge(CommitHook, CommitInfo)}
      * if {@code builder} is a {@link KernelNodeBuilder} instance. Otherwise it throws
      * an {@code IllegalArgumentException}.
      */
     @Override
-    public NodeState merge(@Nonnull NodeBuilder builder, @Nonnull CommitHook commitHook)
-            throws CommitFailedException {
+    public NodeState merge(@Nonnull NodeBuilder builder, @Nonnull CommitHook commitHook,
+            @Nonnull CommitInfo info) throws CommitFailedException {
         checkArgument(builder instanceof KernelRootBuilder);
-        return ((KernelRootBuilder) builder).merge(commitHook);
+        return ((KernelRootBuilder) builder).merge(checkNotNull(commitHook), checkNotNull(info));
     }
 
     /**
@@ -275,8 +277,8 @@ public class KernelNodeStore implements 
         changeDispatcher.beforeCommit(root);
     }
 
-    void localCommit(NodeState root) {
-        changeDispatcher.localCommit(root);
+    void localCommit(NodeState root, CommitInfo info) {
+        changeDispatcher.localCommit(root, info);
     }
 
     void afterCommit(NodeState root) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java Thu Oct 17 09:28:15 2013
@@ -30,6 +30,7 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.state.ConflictAnnotatingRebaseDiff;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -131,8 +132,9 @@ class KernelNodeStoreBranch implements N
 
     @Nonnull
     @Override
-    public NodeState merge(@Nonnull CommitHook hook) throws CommitFailedException {
-        return branchState.merge(checkNotNull(hook));
+    public NodeState merge(@Nonnull CommitHook hook, @Nonnull CommitInfo info)
+            throws CommitFailedException {
+        return branchState.merge(checkNotNull(hook), checkNotNull(info));
     }
 
     @Override
@@ -180,7 +182,8 @@ class KernelNodeStoreBranch implements N
         abstract void rebase();
 
         @Nonnull
-        abstract NodeState merge(@Nonnull CommitHook hook) throws CommitFailedException;
+        abstract NodeState merge(@Nonnull CommitHook hook, @Nonnull CommitInfo info)
+                throws CommitFailedException;
     }
 
     /**
@@ -190,7 +193,7 @@ class KernelNodeStoreBranch implements N
      * <ul>
      *     <li>{@link InMemory} on {@link #setRoot(NodeState)} if the new root differs
      *         from the current base</li>.
-     *     <li>{@link Merged} on {@link #merge(CommitHook)}</li>
+     *     <li>{@link Merged} on {@link #merge(CommitHook, CommitInfo)}</li>
      * </ul>
      */
     private class Unmodified extends BranchState {
@@ -221,7 +224,7 @@ class KernelNodeStoreBranch implements N
         }
 
         @Override
-        NodeState merge(CommitHook hook) throws CommitFailedException {
+        NodeState merge(CommitHook hook, CommitInfo info) throws CommitFailedException {
             branchState = new Merged(base);
             return base;
         }
@@ -236,7 +239,7 @@ class KernelNodeStoreBranch implements N
      *     <li>{@link Unmodified} on {@link #setRoot(NodeState)} if the new root is the same
      *         as the base of this branch or
      *     <li>{@link Persisted} otherwise.
-     *     <li>{@link Merged} on {@link #merge(CommitHook)}</li>
+     *     <li>{@link Merged} on {@link #merge(CommitHook, CommitInfo)}</li>
      * </ul>
      */
     private class InMemory extends BranchState {
@@ -278,7 +281,7 @@ class KernelNodeStoreBranch implements N
         }
 
         @Override
-        NodeState merge(CommitHook hook) throws CommitFailedException {
+        NodeState merge(CommitHook hook, CommitInfo info) throws CommitFailedException {
             mergeLock.lock();
             try {
                 rebase();
@@ -287,7 +290,7 @@ class KernelNodeStoreBranch implements N
                 JsopDiff diff = new JsopDiff(store);
                 toCommit.compareAgainstBaseState(base, diff);
                 NodeState newHead = store.commit(diff.toString(), base);
-                store.localCommit(newHead);
+                store.localCommit(newHead, info);
                 branchState = new Merged(base);
                 return newHead;
             } catch (MicroKernelException e) {
@@ -309,7 +312,7 @@ class KernelNodeStoreBranch implements N
      * <ul>
      *     <li>{@link Unmodified} on {@link #setRoot(NodeState)} if the new root is the same
      *         as the base of this branch.
-     *     <li>{@link Merged} on {@link #merge(CommitHook)}</li>
+     *     <li>{@link Merged} on {@link #merge(CommitHook, CommitInfo)}</li>
      * </ul>
      */
     private class Persisted extends BranchState {
@@ -362,7 +365,7 @@ class KernelNodeStoreBranch implements N
         }
 
         @Override
-        NodeState merge(CommitHook hook) throws CommitFailedException {
+        NodeState merge(CommitHook hook, CommitInfo info) throws CommitFailedException {
             mergeLock.lock();
             try {
                 rebase();
@@ -376,7 +379,7 @@ class KernelNodeStoreBranch implements N
                     toCommit.compareAgainstBaseState(head, diff);
                     commit(diff.toString());
                     NodeState newRoot = store.merge(head);
-                    store.localCommit(newRoot);
+                    store.localCommit(newRoot, info);
                     branchState = new Merged(base);
                     return newRoot;
                 }
@@ -431,7 +434,7 @@ class KernelNodeStoreBranch implements N
         }
 
         @Override
-        NodeState merge(CommitHook hook) throws CommitFailedException {
+        NodeState merge(CommitHook hook, CommitInfo info) throws CommitFailedException {
             throw new IllegalStateException("Branch has already been merged");
         }
     }

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=1533020&r1=1533019&r2=1533020&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 Thu Oct 17 09:28:15 2013
@@ -21,6 +21,7 @@ import static com.google.common.base.Pre
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeBuilder;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
 
@@ -131,9 +132,9 @@ class KernelRootBuilder extends MemoryNo
     /**
      * Merge all changes tracked in this builder into the underlying store.
      */
-    NodeState merge(CommitHook hook) throws CommitFailedException {
+    NodeState merge(CommitHook hook, CommitInfo info) throws CommitFailedException {
         purge();
-        branch.merge(hook);
+        branch.merge(hook, info);
         return reset();
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java Thu Oct 17 09:28:15 2013
@@ -31,6 +31,7 @@ import org.apache.jackrabbit.oak.api.Com
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EditorDiff;
 import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -117,7 +118,7 @@ public class AsyncIndexUpdate implements
                             throw CONCURRENT_UPDATE;
                         }
                     }
-                });
+                }, CommitInfo.EMPTY);
             } catch (CommitFailedException e) {
                 if (e != CONCURRENT_UPDATE) {
                     exception = e;
@@ -142,7 +143,7 @@ public class AsyncIndexUpdate implements
         NodeBuilder builder = store.getRoot().builder();
         preAsyncRunStatus(builder);
         try {
-            store.merge(builder, EmptyHook.INSTANCE);
+            store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
         } catch (CommitFailedException e) {
             log.warn("Index status update {} failed", name, e);
         }

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=1533020&r1=1533019&r2=1533020&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 Oct 17 09:28:15 2013
@@ -33,6 +33,7 @@ import javax.annotation.Nonnull;
 import com.google.common.io.ByteStreams;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.state.ConflictAnnotatingRebaseDiff;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -80,14 +81,15 @@ public class MemoryNodeStore implements 
      *                                  this store
      */
     @Override
-    public synchronized NodeState merge(@Nonnull NodeBuilder builder, @Nonnull CommitHook commitHook)
-            throws CommitFailedException {
+    public synchronized NodeState merge(@Nonnull NodeBuilder builder, @Nonnull CommitHook commitHook,
+            @Nonnull CommitInfo info) throws CommitFailedException {
         checkArgument(builder instanceof MemoryNodeBuilder);
         checkNotNull(commitHook);
-        rebase(checkNotNull(builder));
+        checkNotNull(info);
+        rebase(builder);
         NodeStoreBranch branch = new MemoryNodeStoreBranch(this, getRoot());
         branch.setRoot(builder.getNodeState());
-        NodeState merged = branch.merge(commitHook);
+        NodeState merged = branch.merge(commitHook, info);
         ((MemoryNodeBuilder) builder).reset(merged);
         return merged;
     }
@@ -196,7 +198,8 @@ public class MemoryNodeStore implements 
         }
 
         @Override
-        public NodeState merge(CommitHook hook) throws CommitFailedException {
+        public NodeState merge(@Nonnull CommitHook hook, @Nonnull CommitInfo info)
+                throws CommitFailedException {
             // TODO: rebase();
             checkNotMerged();
             NodeState merged = ModifiedNodeState.squeeze(checkNotNull(hook).processCommit(base, root));

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java Thu Oct 17 09:28:15 2013
@@ -53,6 +53,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.mongomk.util.TimingDocumentStoreWrapper;
 import org.apache.jackrabbit.oak.plugins.mongomk.util.Utils;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
@@ -662,7 +663,8 @@ public final class MongoNodeStore implem
     @Nonnull
     @Override
     public NodeState merge(@Nonnull NodeBuilder builder,
-                           @Nonnull CommitHook commitHook)
+                           @Nonnull CommitHook commitHook,
+                           @Nonnull CommitInfo info)
             throws CommitFailedException {
         // TODO: implement
         return null;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeDispatcher.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeDispatcher.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeDispatcher.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeDispatcher.java Thu Oct 17 09:28:15 2013
@@ -21,8 +21,6 @@ package org.apache.jackrabbit.oak.plugin
 import static com.google.common.base.Objects.toStringHelper;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
-import static org.apache.jackrabbit.oak.api.Type.LONG;
-import static org.apache.jackrabbit.oak.api.Type.STRING;
 
 import java.util.Queue;
 import java.util.Set;
@@ -34,7 +32,7 @@ import javax.annotation.Nonnull;
 import com.google.common.base.Objects;
 import com.google.common.collect.Queues;
 import com.google.common.collect.Sets;
-import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 
@@ -43,7 +41,7 @@ import org.apache.jackrabbit.oak.spi.sta
  * and dispatches them to interested parties.
  * <p>
  * Actual changes are reported by calling {@link #beforeCommit(NodeState)},
- * {@link #localCommit(NodeState)} and {@link #afterCommit(NodeState)} in that order:
+ * {@link #localCommit(NodeState, CommitInfo)} and {@link #afterCommit(NodeState)} in that order:
  * <pre>
       NodeState root = store.getRoot();
       branch.rebase();
@@ -122,9 +120,9 @@ public class ChangeDispatcher {
      * @param root  root node state just persisted
      * @throws IllegalStateException  if not inside a local commit
      */
-    public synchronized void localCommit(@Nonnull NodeState root) {
+    public synchronized void localCommit(@Nonnull NodeState root, @Nonnull CommitInfo info) {
         checkState(inLocalCommit());
-        internalChange(checkNotNull(root));
+        internalChange(checkNotNull(root), checkNotNull(info));
     }
 
     /**
@@ -132,7 +130,7 @@ public class ChangeDispatcher {
      * Calling this method marks this instance to not be inside a local commit.
      * <p>
      * The difference from the root node state passed to the las call to
-     * {@link #localCommit(NodeState)} to {@code root} are reported as cluster external
+     * {@link #localCommit(NodeState, CommitInfo)} to {@code root} are reported as cluster external
      * changes to any listener.
 
      * @param root  latest persisted root node state.
@@ -158,13 +156,13 @@ public class ChangeDispatcher {
 
     private synchronized void externalChange(NodeState root) {
         if (!root.equals(previousRoot)) {
-            add(new ChangeSet(previousRoot, root, true));
+            add(new ChangeSet(previousRoot, root, true, CommitInfo.EMPTY));
             previousRoot = root;
         }
     }
 
-    private synchronized void internalChange(NodeState root) {
-        add(new ChangeSet(previousRoot, root, false));
+    private synchronized void internalChange(NodeState root, CommitInfo info) {
+        add(new ChangeSet(previousRoot, root, false, info));
         previousRoot = root;
     }
 
@@ -238,11 +236,14 @@ public class ChangeDispatcher {
         private final NodeState before;
         private final NodeState after;
         private final boolean isExternal;
+        private final CommitInfo commitInfo;
 
-        ChangeSet(NodeState before, NodeState after, boolean isExternal) {
-            this.before = before;
-            this.after = after;
+        ChangeSet(@Nonnull NodeState before, @Nonnull NodeState after, boolean isExternal,
+                @Nonnull CommitInfo commitInfo) {
+            this.before = checkNotNull(before);
+            this.after = checkNotNull(after);
             this.isExternal = isExternal;
+            this.commitInfo = checkNotNull(commitInfo);
         }
 
         public boolean isExternal() {
@@ -253,19 +254,18 @@ public class ChangeDispatcher {
             return !isExternal && Objects.equal(getSessionId(), sessionId);
         }
 
-        @CheckForNull
+        @Nonnull
         public String getSessionId() {
-            return getStringOrNull(getCommitInfo(after), CommitInfoEditorProvider.SESSION_ID);
+            return commitInfo.getSessionId();
         }
 
-        @CheckForNull
+        @Nonnull
         public String getUserId() {
-            return getStringOrNull(getCommitInfo(after), CommitInfoEditorProvider.USER_ID);
+            return commitInfo.getUserId();
         }
 
         public long getDate() {
-            PropertyState property = getCommitInfo(after).getProperty(CommitInfoEditorProvider.TIME_STAMP);
-            return property == null ? 0 : property.getValue(LONG);
+            return commitInfo.getDate();
         }
 
         /**
@@ -291,10 +291,8 @@ public class ChangeDispatcher {
             return toStringHelper(this)
                 .add("base", before)
                 .add("head", after)
-                .add(CommitInfoEditorProvider.USER_ID, getUserId())
-                .add(CommitInfoEditorProvider.TIME_STAMP, getDate())
-                .add(CommitInfoEditorProvider.SESSION_ID, getSessionId())
                 .add("external", isExternal)
+                .add("commit info", commitInfo)
                 .toString();
         }
 
@@ -303,28 +301,23 @@ public class ChangeDispatcher {
             if (this == other) {
                 return true;
             }
-            if (other.getClass() != this.getClass()) {
+            if (other == null || other.getClass() != this.getClass()) {
                 return false;
             }
 
             ChangeSet that = (ChangeSet) other;
-            return before.equals(that.before) && after.equals(that.after) &&
-                    isExternal == that.isExternal;
+            return isExternal == that.isExternal
+                    && commitInfo.equals(that.commitInfo)
+                    && before.equals(that.before)
+                    && after.equals(that.after);
         }
 
         @Override
         public int hashCode() {
-            return 31 * before.hashCode() + after.hashCode();
+            int hash = before.hashCode();
+            hash = 31 * hash + after.hashCode();
+            hash = 31 * hash + (isExternal ? 1 : 0);
+            return 31 * hash + commitInfo.hashCode();
         }
-
-        private static String getStringOrNull(NodeState commitInfo, String name) {
-            PropertyState property = commitInfo.getProperty(name);
-            return property == null ? null : property.getValue(STRING);
-        }
-
-        private static NodeState getCommitInfo(NodeState after) {
-            return after.getChildNode(CommitInfoEditorProvider.COMMIT_INFO);
-        }
-
     }
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStore.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStore.java Thu Oct 17 09:28:15 2013
@@ -33,6 +33,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.observation.ChangeDispatcher.Listener;
 import org.apache.jackrabbit.oak.plugins.observation.Observable;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EmptyObserver;
 import org.apache.jackrabbit.oak.spi.commit.Observer;
 import org.apache.jackrabbit.oak.spi.state.ConflictAnnotatingRebaseDiff;
@@ -82,11 +83,11 @@ public class SegmentNodeStore implements
         return head;
     }
 
-    boolean setHead(SegmentNodeState base, SegmentNodeState head) {
+    boolean setHead(SegmentNodeState base, SegmentNodeState head, CommitInfo info) {
         changeDispatcher.beforeCommit(base.getChildNode(ROOT));
         try {
             if (journal.setHead(base.getRecordId(), head.getRecordId())) {
-                changeDispatcher.localCommit(head.getChildNode(ROOT));
+                changeDispatcher.localCommit(head.getChildNode(ROOT), info);
                 return true;
             } else {
                 return false;
@@ -109,16 +110,18 @@ public class SegmentNodeStore implements
     @Override
     public synchronized NodeState merge(
             @Nonnull NodeBuilder builder,
-            @Nonnull CommitHook commitHook)
+            @Nonnull CommitHook commitHook,
+            @Nonnull CommitInfo info)
             throws CommitFailedException {
         checkArgument(builder instanceof SegmentNodeBuilder);
         checkNotNull(commitHook);
+        checkNotNull(info);
         SegmentNodeState head = getHead();
         rebase(builder, head.getChildNode(ROOT)); // TODO: can we avoid this?
         SegmentNodeStoreBranch branch = new SegmentNodeStoreBranch(
                 this, store.getWriter(), head, maximumBackoff);
         branch.setRoot(builder.getNodeState());
-        NodeState merged = branch.merge(commitHook);
+        NodeState merged = branch.merge(commitHook, info);
         ((SegmentNodeBuilder) builder).reset(merged);
         return merged;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreBranch.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreBranch.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreBranch.java Thu Oct 17 09:28:15 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.oak.plugins.segment;
 
+import static com.google.common.base.Preconditions.checkNotNull;
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static java.util.concurrent.TimeUnit.NANOSECONDS;
 import static org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore.ROOT;
@@ -28,6 +29,7 @@ import javax.annotation.Nonnull;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.state.ConflictAnnotatingRebaseDiff;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -87,7 +89,7 @@ class SegmentNodeStoreBranch implements 
         }
     }
 
-    private synchronized long optimisticMerge(CommitHook hook)
+    private synchronized long optimisticMerge(CommitHook hook, CommitInfo info)
             throws CommitFailedException, InterruptedException {
         long timeout = 1;
 
@@ -109,7 +111,7 @@ class SegmentNodeStoreBranch implements 
                     && base.getLong("timeout") >= System.currentTimeMillis()) {
                 // someone else has a pessimistic lock on the journal,
                 // so we should not try to commit anything
-            } else if (store.setHead(base, newHead)) {
+            } else if (store.setHead(base, newHead, info)) {
                 base = newHead;
                 head = newHead;
                 return -1;
@@ -133,7 +135,7 @@ class SegmentNodeStoreBranch implements 
         return MILLISECONDS.convert(timeout, NANOSECONDS);
     }
 
-    private synchronized void pessimisticMerge(CommitHook hook, long timeout)
+    private synchronized void pessimisticMerge(CommitHook hook, long timeout, CommitInfo info)
             throws CommitFailedException {
         while (true) {
             SegmentNodeState before = store.getHead();
@@ -150,7 +152,7 @@ class SegmentNodeStoreBranch implements 
 
                 SegmentNodeState after =
                         writer.writeNode(builder.getNodeState());
-                if (store.setHead(before, after)) {
+                if (store.setHead(before, after, info)) {
                     SegmentNodeState originalBase = base;
                     SegmentNodeState originalHead = head;
 
@@ -164,7 +166,7 @@ class SegmentNodeStoreBranch implements 
                     // complete the commit
                     SegmentNodeState newHead =
                             writer.writeNode(builder.getNodeState());
-                    if (store.setHead(after, newHead)) {
+                    if (store.setHead(after, newHead, info)) {
                         base = newHead;
                         head = newHead;
                         return;
@@ -180,13 +182,15 @@ class SegmentNodeStoreBranch implements 
     }
 
     @Override @Nonnull
-    public synchronized NodeState merge(CommitHook hook)
+    public synchronized NodeState merge(@Nonnull CommitHook hook, @Nonnull CommitInfo info)
             throws CommitFailedException {
+        checkNotNull(hook);
+        checkNotNull(info);
         if (base != head) {
             try {
-                long timeout = optimisticMerge(hook);
+                long timeout = optimisticMerge(hook, info);
                 if (timeout >= 0) {
-                    pessimisticMerge(hook, timeout);
+                    pessimisticMerge(hook, timeout, info);
                 }
             } catch (InterruptedException e) {
                 throw new CommitFailedException(

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreService.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreService.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentNodeStoreService.java Thu Oct 17 09:28:15 2013
@@ -39,6 +39,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.segment.file.FileStore;
 import org.apache.jackrabbit.oak.plugins.segment.mongo.MongoStore;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
@@ -165,9 +166,9 @@ public class SegmentNodeStoreService imp
 
     @Nonnull
     @Override
-    public NodeState merge(@Nonnull NodeBuilder builder, @Nonnull CommitHook commitHook)
-            throws CommitFailedException {
-        return getDelegate().merge(builder, commitHook);
+    public NodeState merge(@Nonnull NodeBuilder builder, @Nonnull CommitHook commitHook,
+            @Nonnull CommitInfo info) throws CommitFailedException {
+        return getDelegate().merge(builder, commitHook, info);
     }
 
     @Override

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitInfo.java?rev=1533020&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitInfo.java (added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitInfo.java Thu Oct 17 09:28:15 2013
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.jackrabbit.oak.spi.commit;
+
+import static com.google.common.base.Objects.toStringHelper;
+
+import javax.annotation.Nonnull;
+
+/**
+ * Commit info instances associate some meta data with a commit.
+ */
+public class CommitInfo {
+    public static final String OAK_UNKNOWN = "oak:unknown";
+    public static final CommitInfo EMPTY = new CommitInfo(OAK_UNKNOWN, OAK_UNKNOWN, 0);
+
+    private final String sessionId;
+    private final String userId;
+    private final long date;
+
+    /**
+     * Factory method for creating a new {@code CommitInfo} instance.
+     * Both string arguments default to {@link #OAK_UNKNOWN} if {@code null}.
+     *
+     * @param sessionId  id of the committing session
+     * @param userId  id of the committing user
+     * @param date  time stamp
+     * @return  a fresh {@code CommitInfo} instance
+     */
+    public static CommitInfo create(String sessionId, String userId, long date) {
+        return new CommitInfo(
+                sessionId == null ? OAK_UNKNOWN : sessionId,
+                userId == null ? OAK_UNKNOWN : userId,
+                date);
+    }
+
+    private CommitInfo(@Nonnull String sessionId, @Nonnull String userId, long date) {
+        this.sessionId = sessionId;
+        this.userId = userId;
+        this.date = date;
+    }
+
+    /**
+     * @return  id of the committing session
+     */
+    @Nonnull
+    public String getSessionId() {
+        return sessionId;
+    }
+
+    /**
+     * @return  user id of the committing user
+     */
+    @Nonnull
+    public String getUserId() {
+        return userId;
+    }
+
+    /**
+     * @return  time stamp
+     */
+    public long getDate() {
+        return date;
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this)
+                .add("sessionId", sessionId)
+                .add("userId", userId)
+                .add("date", date)
+                .toString();
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        if (this == other) {
+            return true;
+        }
+        if (other == null || other.getClass() != this.getClass()) {
+            return false;
+        }
+
+        CommitInfo that = (CommitInfo) other;
+        return date == that.date
+                && sessionId.equals(that.sessionId)
+                && userId.equals(that.userId);
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = sessionId.hashCode();
+        hash = 31 * hash + userId.hashCode();
+        return 31 * hash + (int) (date ^ (date >>> 32));
+    }
+}

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/lifecycle/OakInitializer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/lifecycle/OakInitializer.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/lifecycle/OakInitializer.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/lifecycle/OakInitializer.java Thu Oct 17 09:28:15 2013
@@ -24,6 +24,7 @@ import org.apache.jackrabbit.oak.api.Com
 import org.apache.jackrabbit.oak.plugins.index.IndexEditorProvider;
 import org.apache.jackrabbit.oak.plugins.index.IndexUpdateProvider;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EditorHook;
 import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -42,7 +43,7 @@ public final class OakInitializer {
             initializer.initialize(builder);
             store.merge(
                     builder,
-                    new EditorHook(new IndexUpdateProvider(indexEditor)));
+                    new EditorHook(new IndexUpdateProvider(indexEditor)), CommitInfo.EMPTY);
         } catch (CommitFailedException e) {
             throw new RuntimeException(e);
         }
@@ -61,7 +62,7 @@ public final class OakInitializer {
         try {
             store.merge(
                     builder,
-                    new EditorHook(new IndexUpdateProvider(indexEditor)));
+                    new EditorHook(new IndexUpdateProvider(indexEditor)), CommitInfo.EMPTY);
         } catch (CommitFailedException e) {
             throw new RuntimeException(e);
         }

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=1533020&r1=1533019&r2=1533020&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 Oct 17 09:28:15 2013
@@ -25,6 +25,7 @@ import javax.annotation.Nonnull;
 import org.apache.jackrabbit.oak.api.Blob;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 
 /**
  * Storage abstraction for trees. At any given point in time the stored
@@ -50,14 +51,15 @@ public interface NodeStore {
      *
      * @param builder  the builder whose changes to apply
      * @param commitHook the commit hook to apply while merging changes
+     * @param info commit info associated with this merge operation
      * @return the node state resulting from the merge.
      * @throws CommitFailedException if the merge failed
      * @throws IllegalArgumentException if the builder is not acquired
      *                                  from a root state of this store
      */
     @Nonnull
-    NodeState merge(@Nonnull NodeBuilder builder, @Nonnull CommitHook commitHook)
-            throws CommitFailedException;
+    NodeState merge(@Nonnull NodeBuilder builder, @Nonnull CommitHook commitHook,
+            @Nonnull CommitInfo info) throws CommitFailedException;
 
     /**
      * Rebase the changes in the passed {@code builder} on top of the current root state.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStoreBranch.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStoreBranch.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStoreBranch.java Thu Oct 17 09:28:15 2013
@@ -20,6 +20,7 @@ import javax.annotation.Nonnull;
 
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 
 /**
  * An instance of this class represents a private branch of the tree in a
@@ -85,12 +86,13 @@ public interface NodeStoreBranch {
      * the current head revision followed by a fast forward merge.
      *
      * @param hook the commit hook to apply while merging changes
+     * @param info commit info associated with this merge operation
      * @return the node state resulting from the merge.
      * @throws CommitFailedException if the merge failed
      * @throws IllegalStateException if the branch is already merged
      */
     @Nonnull
-    NodeState merge(@Nonnull CommitHook hook) throws CommitFailedException;
+    NodeState merge(@Nonnull CommitHook hook, @Nonnull CommitInfo info) throws CommitFailedException;
 
     /**
      * Rebase the changes from this branch on top of the current

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeBuilderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeBuilderTest.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeBuilderTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeBuilderTest.java Thu Oct 17 09:28:15 2013
@@ -25,6 +25,7 @@ import static junit.framework.Assert.ass
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
@@ -49,7 +50,7 @@ public class KernelNodeBuilderTest {
     private static void init(NodeStore store) throws CommitFailedException {
         NodeBuilder builder = store.getRoot().builder();
         builder.child("x").child("y").child("z");
-        store.merge(builder, EmptyHook.INSTANCE);
+        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
     }
 
     private static void run(NodeStore store) throws CommitFailedException {
@@ -71,7 +72,7 @@ public class KernelNodeBuilderTest {
         assertFalse("child node x/y/z not should not be present", builder
                 .child("x").child("y").hasChildNode("z"));
 
-        store.merge(builder, EmptyHook.INSTANCE);
+        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
     }
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java Thu Oct 17 09:28:15 2013
@@ -32,6 +32,7 @@ import java.util.List;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -57,8 +58,8 @@ public class KernelNodeStateTest {
         builder.child("y");
         builder.child("z");
 
-        state = store.merge(builder, EmptyHook.INSTANCE);
-        state = store.merge(builder, EmptyHook.INSTANCE);
+        state = store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+        state = store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
     }
 
     @After

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreCacheTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreCacheTest.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreCacheTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreCacheTest.java Thu Oct 17 09:28:15 2013
@@ -28,6 +28,7 @@ import javax.annotation.Nonnull;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.api.MicroKernelException;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -60,7 +61,7 @@ public class KernelNodeStoreCacheTest {
         b.child("c");
         b.child("d");
         b.child("e");
-        store.merge(builder, EmptyHook.INSTANCE);
+        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
     }
 
     /**
@@ -137,7 +138,7 @@ public class KernelNodeStoreCacheTest {
     private void modifyContent() throws Exception {
         NodeBuilder builder = store.getRoot().builder();
         builder.child("a").setProperty("foo", "bar");
-        store.merge(builder, EmptyHook.INSTANCE);
+        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
     }
 
     private void readTree(NodeState root) {

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java Thu Oct 17 09:28:15 2013
@@ -24,6 +24,7 @@ import static junit.framework.Assert.ass
 
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -49,7 +50,7 @@ public class LargeKernelNodeStateTest {
             builder.child("x" + i);
         }
 
-        state = store.merge(builder, EmptyHook.INSTANCE);
+        state = store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
     }
 
     @After

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=1533020&r1=1533019&r2=1533020&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 17 09:28:15 2013
@@ -36,6 +36,7 @@ import org.apache.jackrabbit.oak.api.Com
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.plugins.memory.MultiStringPropertyState;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.commit.Observer;
 import org.apache.jackrabbit.oak.spi.state.DefaultNodeStateDiff;
@@ -82,8 +83,8 @@ public class NodeStoreTest {
         test.child("x");
         test.child("y");
         test.child("z");
-        root = store.merge(builder, EmptyHook.INSTANCE);
-        root = store.merge(builder, EmptyHook.INSTANCE);
+        root = store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+        root = store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
     }
 
     @After
@@ -126,7 +127,7 @@ public class NodeStoreTest {
         assertFalse(testState.getChildNode("newNode").exists());
         assertTrue(testState.getChildNode("x").exists());
 
-        store.merge(rootBuilder, EmptyHook.INSTANCE);
+        store.merge(rootBuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         // Assert changes are present in the trunk
         testState = store.getRoot().getChildNode("test");
@@ -157,7 +158,7 @@ public class NodeStoreTest {
 
         testBuilder.getChildNode("a").remove();
 
-        store.merge(rootBuilder, EmptyHook.INSTANCE);
+        store.merge(rootBuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
         NodeState newRoot = store.getRoot(); // triggers the observer
 
         NodeState before = states[0];
@@ -191,7 +192,7 @@ public class NodeStoreTest {
                 testBuilder.child("fromHook");
                 return rootBuilder.getNodeState();
             }
-        });
+        }, CommitInfo.EMPTY);
 
         NodeState test = store.getRoot().getChildNode("test");
         assertTrue(test.getChildNode("newNode").exists());
@@ -208,13 +209,13 @@ public class NodeStoreTest {
         for (int i = 0; i <= KernelNodeState.MAX_CHILD_NODE_NAMES; i++) {
             parent.child("child-" + i);
         }
-        store.merge(root, EmptyHook.INSTANCE);
+        store.merge(root, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         NodeState base = store.getRoot();
         root = base.builder();
         parent = root.child("parent");
         parent.child("child-new");
-        store.merge(root, EmptyHook.INSTANCE);
+        store.merge(root, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         Diff diff = new Diff();
         store.getRoot().compareAgainstBaseState(base, diff);
@@ -227,7 +228,7 @@ public class NodeStoreTest {
         root = base.builder();
         parent = root.getChildNode("parent");
         parent.getChildNode("child-new").moveTo(parent, "child-moved");
-        store.merge(root, EmptyHook.INSTANCE);
+        store.merge(root, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         diff = new Diff();
         store.getRoot().compareAgainstBaseState(base, diff);
@@ -243,7 +244,7 @@ public class NodeStoreTest {
         parent.child("child-moved").setProperty("foo", "value");
         parent.child("child-moved").setProperty(
                 new MultiStringPropertyState("bar", Arrays.asList("value")));
-        store.merge(root, EmptyHook.INSTANCE);
+        store.merge(root, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         diff = new Diff();
         store.getRoot().compareAgainstBaseState(base, diff);
@@ -260,7 +261,7 @@ public class NodeStoreTest {
         parent.setProperty("foo", "value");
         parent.setProperty(new MultiStringPropertyState(
                 "bar", Arrays.asList("value")));
-        store.merge(root, EmptyHook.INSTANCE);
+        store.merge(root, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         diff = new Diff();
         store.getRoot().compareAgainstBaseState(base, diff);
@@ -275,7 +276,7 @@ public class NodeStoreTest {
         root = base.builder();
         parent = root.child("parent");
         parent.getChildNode("child-moved").remove();
-        store.merge(root, EmptyHook.INSTANCE);
+        store.merge(root, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         diff = new Diff();
         store.getRoot().compareAgainstBaseState(base, diff);
@@ -308,7 +309,7 @@ public class NodeStoreTest {
     private static NodeStore init(NodeStore store) throws CommitFailedException {
         NodeBuilder builder = store.getRoot().builder();
         builder.setChildNode("root");
-        store.merge(builder, EmptyHook.INSTANCE);
+        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
         return store;
     }
 
@@ -322,11 +323,11 @@ public class NodeStoreTest {
         builder1.setChildNode("node1");
         builder2.setChildNode("node2");
 
-        store.merge(builder1, EmptyHook.INSTANCE);
+        store.merge(builder1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
         assertTrue(store.getRoot().hasChildNode("node1"));
         assertFalse(store.getRoot().hasChildNode("node2"));
 
-        store.merge(builder2, EmptyHook.INSTANCE);
+        store.merge(builder2, EmptyHook.INSTANCE, CommitInfo.EMPTY);
         assertTrue(store.getRoot().hasChildNode("node1"));
         assertTrue(store.getRoot().hasChildNode("node2"));
     }
@@ -354,7 +355,7 @@ public class NodeStoreTest {
         }
 
         builder.child("foo").child(":bar").child("quz").setProperty("p", "v");
-        store.merge(builder, EmptyHook.INSTANCE);
+        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         NodeState after = store.getRoot();
         Diff diff = new Diff();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java Thu Oct 17 09:28:15 2013
@@ -30,6 +30,7 @@ import com.google.common.collect.Sets;
 import org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider;
 import org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexLookup;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.query.PropertyValues;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -77,7 +78,7 @@ public class AsyncIndexUpdateTest {
         builder.child("testRoot").setProperty("foo", "abc");
 
         // merge it back in
-        store.merge(builder, EmptyHook.INSTANCE);
+        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         AsyncIndexUpdate async = new AsyncIndexUpdate("async", store, provider);
         async.run();
@@ -118,7 +119,7 @@ public class AsyncIndexUpdateTest {
         builder.child("testSecond").setProperty("bar", "ghi");
 
         // merge it back in
-        store.merge(builder, EmptyHook.INSTANCE);
+        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         AsyncIndexUpdate async = new AsyncIndexUpdate("async", store, provider);
         async.run();
@@ -170,7 +171,7 @@ public class AsyncIndexUpdateTest {
                 .setProperty("foo", "xyz");
 
         // merge it back in
-        store.merge(builder, EmptyHook.INSTANCE);
+        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         AsyncIndexUpdate async = new AsyncIndexUpdate("async", store, provider);
         async.run();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndexTest.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndexTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndexTest.java Thu Oct 17 09:28:15 2013
@@ -40,6 +40,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent;
 import org.apache.jackrabbit.oak.query.ast.SelectorImpl;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EditorHook;
 import org.apache.jackrabbit.oak.spi.lifecycle.OakInitializer;
 import org.apache.jackrabbit.oak.spi.query.Cursor;
@@ -78,7 +79,7 @@ public class NodeTypeIndexTest {
         addFile(root, "file-1");
 
         store.merge(root, new EditorHook(new IndexUpdateProvider(
-                new PropertyIndexEditorProvider())));
+                new PropertyIndexEditorProvider())), CommitInfo.EMPTY);
 
         NodeState rootState = store.getRoot();
         NodeTypeIndex index = new NodeTypeIndex();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/JournalTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/JournalTest.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/JournalTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/JournalTest.java Thu Oct 17 09:28:15 2013
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertEqu
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.segment.memory.MemoryStore;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -46,7 +47,7 @@ public class JournalTest {
         builder.setProperty("foo", "bar");
         NodeState newState = builder.getNodeState();
 
-        root.merge(builder, EmptyHook.INSTANCE);
+        root.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         assertEquals(newState, root.getRoot());
         assertEquals(oldState, left.getRoot());
@@ -73,7 +74,7 @@ public class JournalTest {
         builder.setProperty("foo", "bar");
         NodeState newState = builder.getNodeState();
 
-        left.merge(builder, EmptyHook.INSTANCE);
+        left.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         assertEquals(oldState, root.getRoot());
         assertEquals(newState, left.getRoot());
@@ -100,7 +101,7 @@ public class JournalTest {
         leftBuilder.setProperty("foo", "bar");
         NodeState leftState = leftBuilder.getNodeState();
 
-        left.merge(leftBuilder, EmptyHook.INSTANCE);
+        left.merge(leftBuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         assertEquals(oldState, root.getRoot());
         assertEquals(leftState, left.getRoot());
@@ -114,7 +115,7 @@ public class JournalTest {
         NodeBuilder rightBuilder = oldState.builder();
         rightBuilder.setProperty("bar", "foo");
 
-        right.merge(rightBuilder, EmptyHook.INSTANCE);
+        right.merge(rightBuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         store.getJournal("right").merge();
         NodeState newState = root.getRoot();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/MergeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/MergeTest.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/MergeTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/MergeTest.java Thu Oct 17 09:28:15 2013
@@ -28,6 +28,7 @@ import javax.annotation.Nonnull;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.plugins.segment.memory.MemoryStore;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -45,14 +46,14 @@ public class MergeTest {
 
         NodeBuilder a = store.getRoot().builder();
         a.setProperty("foo", "abc");
-        store.merge(a, EmptyHook.INSTANCE);
+        store.merge(a, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         assertTrue(store.getRoot().hasProperty("foo"));
         assertFalse(store.getRoot().hasProperty("bar"));
 
         NodeBuilder b = store.getRoot().builder();
         b.setProperty("bar", "xyz");
-        store.merge(b, EmptyHook.INSTANCE);
+        store.merge(b, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         assertTrue(store.getRoot().hasProperty("foo"));
         assertTrue(store.getRoot().hasProperty("bar"));
@@ -71,12 +72,12 @@ public class MergeTest {
         assertFalse(store.getRoot().hasProperty("foo"));
         assertFalse(store.getRoot().hasProperty("bar"));
 
-        store.merge(a, EmptyHook.INSTANCE);
+        store.merge(a, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         assertTrue(store.getRoot().hasProperty("foo"));
         assertFalse(store.getRoot().hasProperty("bar"));
 
-        store.merge(b, EmptyHook.INSTANCE);
+        store.merge(b, EmptyHook.INSTANCE, CommitInfo.EMPTY);
 
         assertTrue(store.getRoot().hasProperty("foo"));
         assertTrue(store.getRoot().hasProperty("bar"));
@@ -95,7 +96,7 @@ public class MergeTest {
                     try {
                         NodeBuilder a = store.getRoot().builder();
                         a.setProperty("foo", "abc" + i);
-                        store.merge(a, EmptyHook.INSTANCE);
+                        store.merge(a, EmptyHook.INSTANCE, CommitInfo.EMPTY);
                         semaphore.release();
                     } catch (CommitFailedException e) {
                         fail();
@@ -124,7 +125,7 @@ public class MergeTest {
                 }
                 return after;
             }
-        });
+        }, CommitInfo.EMPTY);
 
         assertTrue(store.getRoot().hasProperty("foo"));
         assertTrue(store.getRoot().hasProperty("bar"));

Modified: jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java?rev=1533020&r1=1533019&r2=1533020&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java (original)
+++ jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java Thu Oct 17 09:28:15 2013
@@ -75,6 +75,7 @@ import org.apache.jackrabbit.core.nodety
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.name.Namespaces;
 import org.apache.jackrabbit.oak.plugins.nodetype.RegistrationEditorProvider;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.commit.EditorHook;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
@@ -176,7 +177,8 @@ public class RepositoryUpgrade {
             copyVersionStore(builder, idxToPrefix);
             copyWorkspaces(builder, idxToPrefix);
 
-            target.merge(builder, new EditorHook(new RegistrationEditorProvider())); // TODO: default hooks?
+            target.merge(builder, new EditorHook(new RegistrationEditorProvider()),
+                    CommitInfo.EMPTY); // TODO: default hooks?
         } catch (Exception e) {
             throw new RepositoryException("Failed to copy content", e);
         }



Mime
View raw message