jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1487812 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
Date Thu, 30 May 2013 10:49:23 GMT
Author: mduerig
Date: Thu May 30 10:49:23 2013
New Revision: 1487812

URL: http://svn.apache.org/r1487812
Log:
OAK-851: Slowness while traversing a tree
Avoid reconnecting when there are no pending moves

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java?rev=1487812&r1=1487811&r2=1487812&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
Thu May 30 10:49:23 2013
@@ -465,8 +465,11 @@ public class TreeImpl implements Tree {
 
     private boolean enter() {
         root.checkLive();
-        applyPendingMoves();
-        return reconnect();
+        if (applyPendingMoves()) {
+            return reconnect();
+        } else {
+            return nodeBuilder.exists();
+        }
     }
 
     private static boolean isHidden(String name) {
@@ -487,12 +490,17 @@ public class TreeImpl implements Tree {
         }
     }
 
-    private void applyPendingMoves() {
+    private boolean applyPendingMoves() {
+        boolean movesApplied = false;
         if (parent != null) {
-            parent.applyPendingMoves();
+            movesApplied = parent.applyPendingMoves();
         }
-
+        Move old = pendingMoves;
         pendingMoves = pendingMoves.apply(this);
+        if (pendingMoves != old) {
+            movesApplied = true;
+        }
+        return movesApplied;
     }
 
     private PropertyState getVisibleProperty(String name) {



Mime
View raw message