jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1291745 - in /jackrabbit/sandbox/jackrabbit-mk: jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/
Date Tue, 21 Feb 2012 12:42:08 GMT
Author: mduerig
Date: Tue Feb 21 12:42:08 2012
New Revision: 1291745

URL: http://svn.apache.org/viewvc?rev=1291745&view=rev
Log:
performance hack

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

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=1291745&r1=1291744&r2=1291745&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
Tue Feb 21 12:42:08 2012
@@ -72,6 +72,9 @@ public class WorkspaceItemStateFactory e
         return createNodeState(nodeId, entry);
     }
 
+    // fixme: need better way to determine whether an item exists that catching
+    // fixme: this exceptions. (negative cache, bloom filter)
+    private static ItemNotFoundException infe = new ItemNotFoundException();
     /**
      * Creates the node with information retrieved from the {@code RepositoryService}.
      */
@@ -83,7 +86,7 @@ public class WorkspaceItemStateFactory e
             return createNodeState(info, entry);
         }
         catch (PathNotFoundException e) {
-            throw new ItemNotFoundException(e);
+            throw infe;
         }
     }
 

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=1291745&r1=1291744&r2=1291745&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
Tue Feb 21 12:42:08 2012
@@ -324,6 +324,11 @@ public class RepositoryServiceImpl exten
 
     //------------------------------------------< Reading Items >---
 
+    // fixme: need better way to determine whether an item exists that catching
+    // fixme: these exceptions. (negative cache, bloom filter)
+    private static ItemNotFoundException infe = new ItemNotFoundException();
+    private static PathNotFoundException pnfe = new PathNotFoundException();
+
     @Override
     public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, ItemId
itemId) throws RepositoryException {
         try {
@@ -331,14 +336,16 @@ public class RepositoryServiceImpl exten
             String rev = getRevision(sessionInfo);
             Path itemPath = getPath(itemId, wspName, rev);
             if (!itemPath.isAbsolute()) {
-                throw new ItemNotFoundException(itemId.toString());
+//                throw new ItemNotFoundException(itemId.toString());
+                throw infe;
             }
 
             Path nodePath = itemId.denotesNode() ? itemPath : itemPath.getAncestor(1);
             String mkPath = Paths.pathToString(wspName, nodePath);
 
             if (!microKernel.nodeExists(mkPath, rev)) {
-                throw new PathNotFoundException(itemPath.toString());
+//                throw new PathNotFoundException(itemPath.toString());
+                throw pnfe;
             }
 
             String json = microKernel.getNodes(mkPath, rev, 1, 0, CHILD_NODE_CHUNK_SIZE);



Mime
View raw message