jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1215335 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel: ItemInfos.java RepositoryServiceImpl.java
Date Fri, 16 Dec 2011 23:15:03 GMT
Author: mduerig
Date: Fri Dec 16 23:15:03 2011
New Revision: 1215335

URL: http://svn.apache.org/viewvc?rev=1215335&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
optimize caching to avoid reading first chunk of child nodes twice from Microkernel

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/ItemInfos.java
    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/ItemInfos.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/ItemInfos.java?rev=1215335&r1=1215334&r2=1215335&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/ItemInfos.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/ItemInfos.java
Fri Dec 16 23:15:03 2011
@@ -60,8 +60,7 @@ public final class ItemInfos {
     private ItemInfos() {}
 
     public static Iterator<? extends ItemInfo> buildItemInfos(Path rootPath, final
Path targetPath,
-            String json, Function1<String, QValue> binaryHandler)
-            throws RepositoryException {
+            String json, Function1<String, QValue> binaryHandler) throws RepositoryException
{
 
         final List<ItemInfo> itemInfos = new ArrayList<ItemInfo>();
         final ItemInfo[] targetInfo = new ItemInfo[1];
@@ -69,7 +68,7 @@ public final class ItemInfos {
         Listener listener = new Listener() {
             @Override
             public void createNodeInfo(NodeInfo nodeInfo) {
-                if (nodeInfo.getChildInfos() != null) {  // null indicates an empty node.
Do not include!
+                if (nodeInfo.getChildInfos() != null) {  // xxx hack: null indicates an empty
node. Do not include!
                     if (targetPath.equals(nodeInfo.getPath())) {
                         targetInfo[0] = nodeInfo;
                     }
@@ -171,7 +170,7 @@ public final class ItemInfos {
             super.object(parser, key, tokenizer);
 
             try {
-                nodeInfoBuilder.includeChildInfos(!isEmpty);
+                nodeInfoBuilder.includeChildInfos(!isEmpty);  // xxx hack: mark empty node
                 nodeInfoBuilder = nodeInfoBuilder.build();
                 isEmpty = false;
             }

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=1215335&r1=1215334&r2=1215335&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 23:15:03 2011
@@ -400,7 +400,10 @@ public class RepositoryServiceImpl exten
 
                 private void nextChunk() {
                     try {
-                        String json = microKernel.getNodes(mkPath, rev, 1, pos, CHILD_NODE_CHUNK_SIZE);
+                        // First chunk does not need child nodes. These are most probably
+                        // in the cache already from a preceding call to getItemInfos
+                        int depth = pos == 0 ? 0 : 1;
+                        String json = microKernel.getNodes(mkPath, rev, depth, pos, CHILD_NODE_CHUNK_SIZE);
                         pos += CHILD_NODE_CHUNK_SIZE;
                         Iterator<? extends ItemInfo> infos = buildItemInfos(path, path,
json, readFromDataStore);
                         NodeInfo info = (NodeInfo) infos.next();



Mime
View raw message