jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1524646 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java test/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterTest.java
Date Thu, 19 Sep 2013 07:52:52 GMT
Author: mreutegg
Date: Thu Sep 19 07:52:51 2013
New Revision: 1524646

URL: http://svn.apache.org/r1524646
Log:
OAK-1023: Optimize many child nodes access
- only read the number of documents requested by 'limit'

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java?rev=1524646&r1=1524645&r2=1524646&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
Thu Sep 19 07:52:51 2013
@@ -571,9 +571,7 @@ public class MongoMK implements MicroKer
         // as the starting point
         Iterable<NodeDocument> docs;
         Children c = new Children();
-        // retrieve one more than requested to check if there
-        // are potentially more than 'limit' nodes
-        int rawLimit = (int) Math.min(((long) limit) + 1, Integer.MAX_VALUE);
+        int rawLimit = limit;
         Set<Revision> validRevisions = new HashSet<Revision>();
         do {
             c.children.clear();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterTest.java?rev=1524646&r1=1524645&r2=1524646&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterTest.java
Thu Sep 19 07:52:51 2013
@@ -261,7 +261,7 @@ public class ClusterTest {
         String oldHead = mk2.getHeadRevision();
         
         mk1.commit("/", "+\"test\":{}", null, null);
-        String m1h = mk1.getNodes("/", mk1.getHeadRevision(), 0, 0, 1, null);
+        String m1h = mk1.getNodes("/", mk1.getHeadRevision(), 0, 0, 2, null);
         assertEquals("{\"test\":{},\":childNodeCount\":1}", m1h);
         
         // not available yet...



Mime
View raw message