jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1453734 - /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java
Date Thu, 07 Mar 2013 08:45:47 GMT
Author: mreutegg
Date: Thu Mar  7 08:45:46 2013
New Revision: 1453734

URL: http://svn.apache.org/r1453734
Log:
OAK-619 Lock-free MongoMK implementation
- respect offset and limit in getNodes()

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java?rev=1453734&r1=1453733&r2=1453734&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java
Thu Mar  7 08:45:46 2013
@@ -393,9 +393,13 @@ public class MongoMK implements MicroKer
         includeId |= filter != null && filter.contains(":hash");
         json.object();
         n.append(json, includeId);
-        Children c = readChildren(path, n.getId(), rev, maxChildNodes);
-        for (String s : c.children) {
-            String name = PathUtils.getName(s);
+        // FIXME: must not read all children!
+        Children c = readChildren(path, n.getId(), rev, Integer.MAX_VALUE);
+        for (long i = offset; i < c.children.size(); i++) {
+            if (maxChildNodes-- <= 0) {
+                break;
+            }
+            String name = PathUtils.getName(c.children.get((int) i));
             json.key(name).object().endObject();
         }
         json.key(":childNodeCount").value(c.children.size());



Mime
View raw message