jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1523939 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java
Date Tue, 17 Sep 2013 07:21:22 GMT
Author: mreutegg
Date: Tue Sep 17 07:21:22 2013
New Revision: 1523939

URL: http://svn.apache.org/r1523939
Log:
OAK-926: MongoMK: split documents when they are too large
- Performance optimization when reading a node

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java?rev=1523939&r1=1523938&r2=1523939&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java
Tue Sep 17 07:21:22 2013
@@ -293,7 +293,7 @@ public class NodeDocument extends Docume
      * @param context the revision context
      * @param changeRev the revision of the current change
      * @param handler the conflict handler, which is called for concurrent changes
-     *                preceding <code>before</code>.
+     *                preceding <code>changeRev</code>.
      * @return the revision, or null if deleted
      */
     @SuppressWarnings("unchecked")
@@ -302,10 +302,11 @@ public class NodeDocument extends Docume
                                       Revision changeRev,
                                       CollisionHandler handler) {
         SortedSet<String> revisions = new TreeSet<String>(Collections.reverseOrder());
-        revisions.addAll(getRevisions().keySet());
-        revisions.addAll(getCommitRoot().keySet());
-        Map<String, String> deletedMap = getDeleted();
-        revisions.addAll(deletedMap.keySet());
+        // no need to look at all commits. the primary document
+        // always contains at least one commit, including all
+        // branch commits which are not yet merged
+        revisions.addAll(getLocalRevisions().keySet());
+        revisions.addAll(getLocalCommitRoot().keySet());
         Revision newestRev = null;
         for (String r : revisions) {
             Revision propRev = Revision.fromString(r);
@@ -329,7 +330,8 @@ public class NodeDocument extends Docume
         if (newestRev == null) {
             return null;
         }
-        String value = deletedMap.get(newestRev.toString());
+
+        String value = getDeleted().get(newestRev.toString());
         if ("true".equals(value)) {
             // deleted in the newest revision
             return null;
@@ -1029,11 +1031,6 @@ public class NodeDocument extends Docume
     }
 
     @Nonnull
-    private Map<String, String> getRevisions() {
-        return ValueMap.create(this, REVISIONS);
-    }
-
-    @Nonnull
     private Map<String, String> getDeleted() {
         return ValueMap.create(this, DELETED);
     }



Mime
View raw message