jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1215203 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: hierarchy/ChildNodeEntries.java state/ItemStateFactory.java state/TransientISFactory.java state/WorkspaceItemStateFactory.java
Date Fri, 16 Dec 2011 16:04:15 GMT
Author: mduerig
Date: Fri Dec 16 16:04:14 2011
New Revision: 1215203

URL: http://svn.apache.org/viewvc?rev=1215203&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
improve resolution of child node entries, avoid cache misses

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntries.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntries.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntries.java?rev=1215203&r1=1215202&r2=1215203&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntries.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntries.java
Fri Dec 16 16:04:14 2011
@@ -22,7 +22,6 @@ import org.apache.jackrabbit.jcr2spi.sta
 import org.apache.jackrabbit.spi.ChildInfo;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
-import org.apache.jackrabbit.spi.NodeInfo;
 import org.apache.jackrabbit.spi.commons.util.Function1;
 import org.apache.jackrabbit.spi.commons.util.Iterators;
 import org.apache.jackrabbit.spi.commons.util.Predicate1;
@@ -205,9 +204,8 @@ final class ChildNodeEntries {
 
     private NodeEntry resolve(Name nodeName) throws RepositoryException {
         try {
-            NodeId nodeId = parent.getWorkspaceId();
-            NodeInfo nodeInfo = factory.getItemStateFactory().getNodeInfo(nodeId, nodeName);
-            NodeEntry nodeEntry = factory.createNodeEntry(parent, nodeInfo.getPath().getName(),
nodeInfo.getId().getUniqueID());
+            NodeEntry nodeEntry = factory.createNodeEntry(parent, nodeName, null);
+            factory.getItemStateFactory().createNodeState(nodeEntry.getId(), nodeEntry);
             loaded.put(nodeEntry.getName(), nodeEntry);
             return nodeEntry;
         }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateFactory.java?rev=1215203&r1=1215202&r2=1215203&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateFactory.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateFactory.java
Fri Dec 16 16:04:14 2011
@@ -21,7 +21,6 @@ import org.apache.jackrabbit.jcr2spi.hie
 import org.apache.jackrabbit.spi.ChildInfo;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
-import org.apache.jackrabbit.spi.NodeInfo;
 import org.apache.jackrabbit.spi.PropertyId;
 
 import javax.jcr.ItemNotFoundException;
@@ -111,18 +110,6 @@ public interface ItemStateFactory {
     Iterator<ChildInfo> getChildNodeInfos(NodeId nodeId) throws ItemNotFoundException,
RepositoryException;
 
     /**
-     * Returns the {@code ChildInfo} {@code name} of the node identified by {@code nodId}.
Or 
-     * {@code null} if the node does not have a child of that name.
-     *
-     *
-     *
-     * @param nodeId
-     * @param name
-     * @throws ItemNotFoundException if {@code nodId} does not exist
-     */
-    NodeInfo getNodeInfo(NodeId nodeId, Name name) throws RepositoryException;
-
-    /**
      * Returns the identifiers of all reference properties that  point to
      * the given node.
      *

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java?rev=1215203&r1=1215202&r2=1215203&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
Fri Dec 16 16:04:14 2011
@@ -22,7 +22,6 @@ import org.apache.jackrabbit.jcr2spi.nod
 import org.apache.jackrabbit.spi.ChildInfo;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
-import org.apache.jackrabbit.spi.NodeInfo;
 import org.apache.jackrabbit.spi.PropertyId;
 import org.apache.jackrabbit.spi.QNodeDefinition;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
@@ -109,11 +108,6 @@ public final class TransientISFactory ex
     }
 
     @Override
-    public NodeInfo getNodeInfo(NodeId nodeId, Name name) throws RepositoryException {
-        return workspaceStateFactory.getNodeInfo(nodeId, name);
-    }
-
-    @Override
     public Iterator<PropertyId> getNodeReferences(NodeState nodeState, Name propertyName,
boolean weak)
             throws RepositoryException {
         

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java?rev=1215203&r1=1215202&r2=1215203&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
Fri Dec 16 16:04:14 2011
@@ -21,14 +21,12 @@ import org.apache.jackrabbit.jcr2spi.hie
 import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider;
 import org.apache.jackrabbit.spi.ChildInfo;
-import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.ItemInfo;
 import org.apache.jackrabbit.spi.ItemInfoCache;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.NodeInfo;
 import org.apache.jackrabbit.spi.Path;
-import org.apache.jackrabbit.spi.PathFactory;
 import org.apache.jackrabbit.spi.PropertyId;
 import org.apache.jackrabbit.spi.PropertyInfo;
 import org.apache.jackrabbit.spi.RepositoryService;
@@ -160,17 +158,6 @@ public class WorkspaceItemStateFactory e
     }
 
     @Override
-    public NodeInfo getNodeInfo(NodeId nodeId, Name name) throws RepositoryException {
-        PathFactory pathFactory = service.getPathFactory();
-        Path path = pathFactory.create(name);
-
-        IdFactory idFactory = service.getIdFactory();
-        NodeId childNodeId = idFactory.createNodeId(nodeId, path);
-
-        return getNodeInfo(childNodeId);
-    }
-
-    @Override
     public Iterator<PropertyId> getNodeReferences(NodeState nodeState, Name propertyName,
boolean weak)
             throws RepositoryException {
         
@@ -359,7 +346,7 @@ public class WorkspaceItemStateFactory e
      * @return the hierarchy entry for {@code info}
      * @throws RepositoryException
      */
-    private HierarchyEntry<?> createHierarchyEntries(ItemInfo info, NodeEntry anyParent)
+    private static HierarchyEntry<?> createHierarchyEntries(ItemInfo info, NodeEntry
anyParent)
             throws RepositoryException {
 
         // Calculate relative path of missing entries



Mime
View raw message