jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1537547 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java
Date Thu, 31 Oct 2013 16:38:20 GMT
Author: jukka
Date: Thu Oct 31 16:38:20 2013
New Revision: 1537547

URL: http://svn.apache.org/r1537547
Log:
OAK-1132: QueryEngine #executeQuery creates a new revision on each call

Use the base state for query index lookups

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java?rev=1537547&r1=1537546&r2=1537547&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/AbstractRoot.java
Thu Oct 31 16:38:20 2013
@@ -328,15 +328,12 @@ public abstract class AbstractRoot imple
         return new QueryEngineImpl() {
             @Override
             protected ExecutionContext getExecutionContext() {
-                NodeState rootState = AbstractRoot.this.getRootState();
-                return new ExecutionContext(rootState, rootTree, getIndexProvider(rootState));
-            }
-
-            private QueryIndexProvider getIndexProvider(NodeState rootState) {
+                QueryIndexProvider provider = indexProvider;
                 if (hasPendingChanges()) {
-                    return new UUIDDiffIndexProviderWrapper(indexProvider, getBaseState(),
rootState);
+                    provider = new UUIDDiffIndexProviderWrapper(
+                            provider, getBaseState(), getRootState());
                 }
-                return indexProvider;
+                return new ExecutionContext(getBaseState(), rootTree, provider);
             }
         };
     }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java?rev=1537547&r1=1537546&r2=1537547&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java
Thu Oct 31 16:38:20 2013
@@ -52,6 +52,7 @@ public class TraversingIndexQueryTest ex
         //OAK-1024 allow '/' in a full-text query 
         Tree node = root.getTree("/").addChild("content");
         node.setProperty("jcr:mimeType", "text/plain");
+        root.commit();
         assertQuery("//*[jcr:contains(., 'text/plain')]", "xpath",
                 ImmutableList.of("/content"));
     }
@@ -61,6 +62,7 @@ public class TraversingIndexQueryTest ex
         Tree c = root.getTree("/").addChild("content");
         c.addChild("testFullTextTermNameSimple");
         c.addChild("testFullTextTermNameFile.txt");
+        root.commit();
         assertQuery("//*[jcr:contains(., 'testFullTextTermNameSimple')]",
                 "xpath",
                 ImmutableList.of("/content/testFullTextTermNameSimple"));



Mime
View raw message