jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1420594 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
Date Wed, 12 Dec 2012 09:51:14 GMT
Author: jukka
Date: Wed Dec 12 09:51:12 2012
New Revision: 1420594

URL: http://svn.apache.org/viewvc?rev=1420594&view=rev
Log:
OAK-506: Avoid extra MK.nodeExists() calls when already cached

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java?rev=1420594&r1=1420593&r2=1420594&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
Wed Dec 12 09:51:12 2012
@@ -170,7 +170,11 @@ public final class KernelNodeState exten
         String childPath = childPaths.get(name);
         if (childPath == null && childNodeCount > MAX_CHILD_NODE_NAMES) {
             String path = getChildPath(name);
-            if (kernel.nodeExists(path, revision)) {
+            // OAK-506: Avoid the nodeExists() call when already cached
+            NodeState state = cache.getIfPresent(revision + path);
+            if (state != null) {
+                return state;
+            } else if (kernel.nodeExists(path, revision)) {
                 childPath = path;
             }
         }



Mime
View raw message