jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1522490 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk: Branch.java RevisionContext.java UnmergedBranches.java
Date Thu, 12 Sep 2013 08:53:39 GMT
Author: mreutegg
Date: Thu Sep 12 08:53:38 2013
New Revision: 1522490

URL: http://svn.apache.org/r1522490
Log:
OAK-926: MongoMK: split documents when they are too large
- Use Comparator<Revision> instead of Revision.RevisionComparator where possible

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Branch.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/RevisionContext.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnmergedBranches.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Branch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Branch.java?rev=1522490&r1=1522489&r2=1522490&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Branch.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Branch.java
Thu Sep 12 08:53:38 2013
@@ -47,16 +47,13 @@ class Branch {
      *
      * @param commits the initial branch commits.
      * @param base the base commit.
-     * @param comparator the revision comparator.
      * @throws IllegalArgumentException if base is a branch revision.
      */
     Branch(@Nonnull SortedSet<Revision> commits,
-           @Nonnull Revision base,
-           @Nonnull Revision.RevisionComparator comparator) {
+           @Nonnull Revision base) {
         checkArgument(!checkNotNull(base).isBranch(), "base is not a trunk revision: %s",
base);
         this.base = base;
-        this.commits = new TreeMap<Revision, BranchCommit>(
-                checkNotNull(comparator));
+        this.commits = new TreeMap<Revision, BranchCommit>(commits.comparator());
         for (Revision r : commits) {
             this.commits.put(r.asBranchRevision(), new BranchCommit(base));
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/RevisionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/RevisionContext.java?rev=1522490&r1=1522489&r2=1522490&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/RevisionContext.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/RevisionContext.java
Thu Sep 12 08:53:38 2013
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.oak.plugins.mongomk;
 
+import java.util.Comparator;
+
 /**
  * Provides revision related context.
  */
@@ -35,7 +37,7 @@ public interface RevisionContext {
     /**
      * @return the revision comparator.
      */
-    public Revision.RevisionComparator getRevisionComparator();
+    public Comparator<Revision> getRevisionComparator();
 
     /**
      * Ensure the revision visible from now on, possibly by updating the head

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnmergedBranches.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnmergedBranches.java?rev=1522490&r1=1522489&r2=1522490&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnmergedBranches.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnmergedBranches.java
Thu Sep 12 08:53:38 2013
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.oak.plugins.mongomk;
 
 import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.List;
 import java.util.SortedMap;
 import java.util.SortedSet;
@@ -50,9 +51,9 @@ class UnmergedBranches {
     /**
      * The revision comparator.
      */
-    private final Revision.RevisionComparator comparator;
+    private final Comparator<Revision> comparator;
 
-    UnmergedBranches(@Nonnull Revision.RevisionComparator comparator) {
+    UnmergedBranches(@Nonnull Comparator<Revision> comparator) {
         this.comparator = checkNotNull(comparator);
     }
 
@@ -81,7 +82,7 @@ class UnmergedBranches {
                 commits.add(base);
                 base = revisions.remove(base).asTrunkRevision();
             }
-            branches.add(new Branch(commits, base, comparator));
+            branches.add(new Branch(commits, base));
         }
     }
 
@@ -101,7 +102,7 @@ class UnmergedBranches {
                 "initial is not a branch revision: %s", initial);
         SortedSet<Revision> commits = new TreeSet<Revision>(comparator);
         commits.add(initial);
-        Branch b = new Branch(commits, base, comparator);
+        Branch b = new Branch(commits, base);
         synchronized (branches) {
             branches.add(b);
         }



Mime
View raw message