jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1215213 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Date Fri, 16 Dec 2011 16:36:28 GMT
Author: mduerig
Date: Fri Dec 16 16:36:28 2011
New Revision: 1215213

URL: http://svn.apache.org/viewvc?rev=1215213&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
enable batch reading for getNodes() calls

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java?rev=1215213&r1=1215212&r2=1215213&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Fri Dec 16 16:36:28 2011
@@ -33,6 +33,7 @@ import org.apache.jackrabbit.spi.EventFi
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.ItemId;
 import org.apache.jackrabbit.spi.ItemInfo;
+import org.apache.jackrabbit.spi.ItemInfoCache;
 import org.apache.jackrabbit.spi.LockInfo;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
@@ -356,6 +357,7 @@ public class RepositoryServiceImpl exten
             final String rev = getRevision(sessionInfo);
             final Path path = getPath(parentId, wspName, rev);
             final String mkPath = Paths.pathToString(wspName, path);
+            final ItemInfoCache itemInfoCache = sessionInfo.getItemInfoCache();
 
             if (!microKernel.nodeExists(mkPath, rev)) {
                 throw new PathNotFoundException(path.toString());
@@ -398,11 +400,19 @@ public class RepositoryServiceImpl exten
 
                 private void nextChunk() {
                     try {
-                        String json = microKernel.getNodes(mkPath, rev, 0, pos, CHILD_NODE_CHUNK_SIZE);
+                        String json = microKernel.getNodes(mkPath, rev, 1, pos, CHILD_NODE_CHUNK_SIZE);
                         pos += CHILD_NODE_CHUNK_SIZE;
                         Iterator<? extends ItemInfo> infos = buildItemInfos(path, path,
json, readFromDataStore);
                         NodeInfo info = (NodeInfo) infos.next();
                         currentChunk = info.getChildInfos();
+
+                        // Put child items into item info cache to avoid further round trips
+                        // when this iterator is traversed.
+                        itemInfoCache.put(info);
+                        while (infos.hasNext()) {
+                            itemInfoCache.put(infos.next());
+                        }
+                        
                     }
                     catch (RepositoryException e) {
                         // fixme think of a better way to handle this



Mime
View raw message