jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meteata...@apache.org
Subject svn commit: r1430200 - in /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl: action/FetchHeadRevisionIdAction.java command/MergeCommand.java command/WaitForCommitCommand.java
Date Tue, 08 Jan 2013 10:12:42 GMT
Author: meteatamel
Date: Tue Jan  8 10:12:41 2013
New Revision: 1430200

URL: http://svn.apache.org/viewvc?rev=1430200&view=rev
Log:
OAK-540 - MongoMK.getHeadRevision() returns branch revision 

Changed FetchHeadRevisionIdAction to ignore branches.

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchHeadRevisionIdAction.java
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/WaitForCommitCommand.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchHeadRevisionIdAction.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchHeadRevisionIdAction.java?rev=1430200&r1=1430199&r2=1430200&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchHeadRevisionIdAction.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchHeadRevisionIdAction.java
Tue Jan  8 10:12:41 2013
@@ -31,8 +31,6 @@ import com.mongodb.QueryBuilder;
  */
 public class FetchHeadRevisionIdAction extends BaseAction<Long> {
 
-    private boolean includeBranchCommits = true;
-
     /**
      * Constructs a new {@code FetchHeadRevisionIdAction}.
      *
@@ -42,25 +40,13 @@ public class FetchHeadRevisionIdAction e
         super(nodeStore);
     }
 
-    /**
-     * Sets whether the branch commits are included in the query.
-     *
-     * @param includeBranchCommits Whether the branch commits are included.
-     */
-    public void includeBranchCommits(boolean includeBranchCommits) {
-        this.includeBranchCommits = includeBranchCommits;
-    }
-
     @Override
     public Long execute() throws Exception {
         DBCollection headCollection = nodeStore.getSyncCollection();
         MongoSync syncMongo = (MongoSync)headCollection.findOne();
         long headRevisionId = syncMongo.getHeadRevisionId();
-        if (includeBranchCommits) {
-            return headRevisionId;
-        }
 
-        // Otherwise, find the first revision id that's not part of a branch.
+        // Find the first revision id that's not part of a branch.
         DBCollection collection = nodeStore.getCommitCollection();
         DBObject query = QueryBuilder.start(MongoCommit.KEY_FAILED).notEquals(Boolean.TRUE)
                 .and(MongoCommit.KEY_REVISION_ID).lessThanEquals(headRevisionId)

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=1430200&r1=1430199&r2=1430200&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
Tue Jan  8 10:12:41 2013
@@ -59,7 +59,6 @@ public class MergeCommand extends BaseCo
         long rootNodeId = commit.getRevisionId();
 
         FetchHeadRevisionIdAction query2 = new FetchHeadRevisionIdAction(nodeStore);
-        query2.includeBranchCommits(false);
         long currentHead = query2.execute();
 
         Node ourRoot = getNode("/", rootNodeId, branchId);

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/WaitForCommitCommand.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/WaitForCommitCommand.java?rev=1430200&r1=1430199&r2=1430200&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/WaitForCommitCommand.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/WaitForCommitCommand.java
Tue Jan  8 10:12:41 2013
@@ -55,7 +55,6 @@ public class WaitForCommitCommand extend
 
     private long getHeadRevision() throws Exception {
         FetchHeadRevisionIdAction query = new FetchHeadRevisionIdAction(nodeStore);
-        query.includeBranchCommits(false);
         return query.execute();
     }
 }
\ No newline at end of file



Mime
View raw message