jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meteata...@apache.org
Subject svn commit: r1414732 - in /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl: MongoMicroKernel.java action/FetchBranchBaseRevisionIdAction.java action/FetchNodesAction.java command/MergeCommand.java
Date Wed, 28 Nov 2012 14:43:50 GMT
Author: meteatamel
Date: Wed Nov 28 14:43:49 2012
New Revision: 1414732

URL: http://svn.apache.org/viewvc?rev=1414732&view=rev
Log:
Minor optimization to include base revision id in the branch id and remove the need for FetchBranchBaseRevisionId

Removed:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchBranchBaseRevisionIdAction.java
Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/MongoMicroKernel.java
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesAction.java
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/MongoMicroKernel.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/MongoMicroKernel.java?rev=1414732&r1=1414731&r2=1414732&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/MongoMicroKernel.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/MongoMicroKernel.java
Wed Nov 28 14:43:49 2012
@@ -89,7 +89,7 @@ public class MongoMicroKernel implements
         try {
             MongoCommit commit = (MongoCommit)CommitBuilder.build("", "", revId,
                     MongoNodeStore.INITIAL_COMMIT_MESSAGE);
-            commit.setBranchId(UUID.randomUUID().toString());
+            commit.setBranchId(revId + "-" + UUID.randomUUID().toString());
             return nodeStore.commit(commit);
         } catch (Exception e) {
             throw new MicroKernelException(e);

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesAction.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesAction.java?rev=1414732&r1=1414731&r2=1414732&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesAction.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesAction.java
Wed Nov 28 14:43:49 2012
@@ -147,8 +147,7 @@ public class FetchNodesAction extends Ba
         } else {
             // Not only return nodes in the branch but also nodes in the trunk
             // before the branch was created.
-            FetchBranchBaseRevisionIdAction action = new FetchBranchBaseRevisionIdAction(nodeStore,
branchId);
-            long headBranchRevisionId = action.execute();
+            long headBranchRevisionId = Long.parseLong(branchId.substring(0, branchId.indexOf("-")));
 
             DBObject branchQuery = QueryBuilder.start().or(
                     QueryBuilder.start(MongoNode.KEY_BRANCH_ID).is(branchId).get(),

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java?rev=1414732&r1=1414731&r2=1414732&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java
Wed Nov 28 14:43:49 2012
@@ -9,7 +9,6 @@ import org.apache.jackrabbit.mongomk.api
 import org.apache.jackrabbit.mongomk.api.model.Commit;
 import org.apache.jackrabbit.mongomk.api.model.Node;
 import org.apache.jackrabbit.mongomk.impl.MongoNodeStore;
-import org.apache.jackrabbit.mongomk.impl.action.FetchBranchBaseRevisionIdAction;
 import org.apache.jackrabbit.mongomk.impl.action.FetchCommitAction;
 import org.apache.jackrabbit.mongomk.impl.action.FetchHeadRevisionIdAction;
 import org.apache.jackrabbit.mongomk.impl.model.CommitBuilder;
@@ -65,8 +64,7 @@ public class MergeCommand extends BaseCo
 
         Node ourRoot = getNode("/", rootNodeId, branchId);
 
-        FetchBranchBaseRevisionIdAction branchAction = new FetchBranchBaseRevisionIdAction(nodeStore,
branchId);
-        long branchRootId = branchAction.execute();
+        long branchRootId = Long.parseLong(branchId.substring(0, branchId.indexOf("-")));
 
         // Merge nodes from head to branch.
         ourRoot = mergeNodes(ourRoot, currentHead, branchRootId);



Mime
View raw message