jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1392308 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/core/ main/java/org/apache/jackrabbit/oak/plugins/lucene/ main/java/org/apache/jackrabbit/oak/plugins/unique/ main/java/org/apache/jackrabbit/oak/query/ m...
Date Mon, 01 Oct 2012 12:54:47 GMT
Author: alexparvulescu
Date: Mon Oct  1 12:54:46 2012
New Revision: 1392308

URL: http://svn.apache.org/viewvc?rev=1392308&view=rev
Log:
OAK-353Remove MicroKernel and revisionId info from the QueryEngine

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/unique/UniqueIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PrefixContentIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingCursorTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
Mon Oct  1 12:54:46 2012
@@ -117,7 +117,7 @@ public class ContentRepositoryImpl imple
 
         QueryIndexProvider qip = indexProvider != null ? indexProvider
                 : new CompositeQueryIndexProvider();
-        queryEngine = new QueryEngineImpl(nodeStore, microKernel, qip);
+        queryEngine = new QueryEngineImpl(nodeStore, qip);
 
         // TODO: use configurable context provider
         loginContextProvider = new LoginContextProviderImpl(this);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndex.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndex.java
Mon Oct  1 12:54:46 2012
@@ -88,7 +88,7 @@ public class LuceneIndex implements Quer
     }
 
     @Override
-    public Cursor query(Filter filter, String revisionId, NodeState root) {
+    public Cursor query(Filter filter, NodeState root) {
 
         NodeBuilder builder = new ReadOnlyBuilder(root);
         for (String name : path) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/unique/UniqueIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/unique/UniqueIndex.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/unique/UniqueIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/unique/UniqueIndex.java
Mon Oct  1 12:54:46 2012
@@ -61,7 +61,7 @@ public class UniqueIndex implements Quer
     }
 
     @Override
-    public Cursor query(Filter filter, String revisionId, NodeState root) {
+    public Cursor query(Filter filter, NodeState root) {
         NodeState state = root.getChildNode("jcr:system");
         if (state != null) {
             state = state.getChildNode(":unique");

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
Mon Oct  1 12:54:46 2012
@@ -24,7 +24,6 @@ import java.util.List;
 
 import javax.jcr.PropertyType;
 
-import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
@@ -57,7 +56,7 @@ import org.apache.jackrabbit.oak.query.a
 import org.apache.jackrabbit.oak.query.ast.SelectorImpl;
 import org.apache.jackrabbit.oak.query.ast.SourceImpl;
 import org.apache.jackrabbit.oak.query.ast.UpperCaseImpl;
-import org.apache.jackrabbit.oak.query.index.FilterImpl;
+import org.apache.jackrabbit.oak.spi.query.Filter;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
@@ -85,7 +84,6 @@ public class Query {
     final HashMap<String, Integer> selectorIndexes = new HashMap<String, Integer>();
     final ArrayList<SelectorImpl> selectors = new ArrayList<SelectorImpl>();
 
-    private MicroKernel mk;
     private QueryEngineImpl queryEngine;
     private final OrderingImpl[] orderings;
     private ColumnImpl[] columns;
@@ -287,10 +285,6 @@ public class Query {
         bindVariableMap.put(varName, value);
     }
 
-    public void setMicroKernel(MicroKernel mk) {
-        this.mk = mk;
-    }
-
     public void setLimit(long limit) {
         this.limit = limit;
     }
@@ -311,11 +305,11 @@ public class Query {
         this.measure = measure;
     }
 
-    public ResultImpl executeQuery(String revisionId, NodeState root) {
-        return new ResultImpl(this, revisionId, root);
+    public ResultImpl executeQuery(NodeState root) {
+        return new ResultImpl(this, root);
     }
 
-    Iterator<ResultRowImpl> getRows(String revisionId, NodeState root) {
+    Iterator<ResultRowImpl> getRows(NodeState root) {
         prepare();
         Iterator<ResultRowImpl> it;
         if (explain) {
@@ -327,7 +321,7 @@ public class Query {
                     null);
             it = Arrays.asList(r).iterator();
         } else {
-            it = new RowIterator(revisionId, root, limit, offset);
+            it = new RowIterator(root, limit, offset);
             long resultCount = 0;
             if (orderings != null) {
                 // TODO "order by" is not necessary if the used index returns
@@ -530,7 +524,7 @@ public class Query {
             return;
         }
         prepared = true;
-        source.prepare(mk);
+        source.prepare();
     }
 
     /**
@@ -538,14 +532,12 @@ public class Query {
      */
     class RowIterator implements Iterator<ResultRowImpl> {
 
-        private final String revisionId;
         private final NodeState root;
         private ResultRowImpl current;
         private boolean started, end;
         private long limit, offset, rowIndex;
 
-        RowIterator(String revisionId, NodeState root, long limit, long offset) {
-            this.revisionId = revisionId;
+        RowIterator(NodeState root, long limit, long offset) {
             this.root = root;
             this.limit = limit;
             this.offset = offset;
@@ -560,7 +552,7 @@ public class Query {
                 return;
             }
             if (!started) {
-                source.execute(revisionId, root);
+                source.execute(root);
                 started = true;
             }
             while (true) {
@@ -689,7 +681,7 @@ public class Query {
         this.queryEngine = queryEngine;
     }
 
-    public QueryIndex getBestIndex(FilterImpl filter) {
+    public QueryIndex getBestIndex(Filter filter) {
         return queryEngine.getBestIndex(filter);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
Mon Oct  1 12:54:46 2012
@@ -22,14 +22,13 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
-import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.query.index.TraversingIndex;
+import org.apache.jackrabbit.oak.spi.query.Filter;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
@@ -45,13 +44,11 @@ public class QueryEngineImpl {
     static final String JQOM = "JCR-JQOM";
 
     private final NodeStore store;
-    private final MicroKernel mk;
     private final CoreValueFactory vf;
     private final QueryIndexProvider indexProvider;
 
-    public QueryEngineImpl(NodeStore store, MicroKernel mk, QueryIndexProvider indexProvider)
{
+    public QueryEngineImpl(NodeStore store, QueryIndexProvider indexProvider) {
         this.store = store;
-        this.mk = mk;
         this.vf = store.getValueFactory();
         this.indexProvider = indexProvider;
     }
@@ -107,7 +104,6 @@ public class QueryEngineImpl {
         q.setNamePathMapper(namePathMapper);
         q.setLimit(limit);
         q.setOffset(offset);
-        q.setMicroKernel(mk);
         if (bindings != null) {
             for (Entry<String, ? extends CoreValue> e : bindings.entrySet()) {
                 q.bindValue(e.getKey(), e.getValue());
@@ -115,13 +111,10 @@ public class QueryEngineImpl {
         }
         q.setQueryEngine(this);
         q.prepare();
-        // TODO which revision to use? Root does not provide this info
-        // TODO which node state to use? it should come from the Root
-        String revision = mk.getHeadRevision();
-        return q.executeQuery(revision, store.getRoot());
+        return q.executeQuery(store.getRoot());
     }
 
-    public QueryIndex getBestIndex(FilterImpl filter) {
+    public QueryIndex getBestIndex(Filter filter) {
         QueryIndex best = null;
         double bestCost = Double.MAX_VALUE;
         for (QueryIndex index : getIndexes()) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultImpl.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultImpl.java
Mon Oct  1 12:54:46 2012
@@ -30,12 +30,10 @@ import org.apache.jackrabbit.oak.spi.sta
 public class ResultImpl implements Result {
 
     protected final Query query;
-    protected final String revisionId;
     protected final NodeState root;
 
-    ResultImpl(Query query, String revisionId, NodeState root) {
+    ResultImpl(Query query, NodeState root) {
         this.query = query;
-        this.revisionId = revisionId;
         this.root = root;
     }
 
@@ -65,7 +63,7 @@ public class ResultImpl implements Resul
 
             @Override
             public Iterator<ResultRowImpl> iterator() {
-                return query.getRows(revisionId, root);
+                return query.getRows(root);
             }
 
         };

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
Mon Oct  1 12:54:46 2012
@@ -13,7 +13,6 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.oak.query.Query;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
@@ -32,7 +31,6 @@ public class JoinImpl extends SourceImpl
     private boolean foundJoinedRow;
     private boolean end;
     private NodeState root;
-    private String revisionId;
 
     public JoinImpl(SourceImpl left, SourceImpl right, JoinType joinType,
             JoinConditionImpl joinCondition) {
@@ -103,9 +101,9 @@ public class JoinImpl extends SourceImpl
     }
 
     @Override
-    public void prepare(MicroKernel mk) {
-        left.prepare(mk);
-        right.prepare(mk);
+    public void prepare() {
+        left.prepare();
+        right.prepare();
     }
 
     @Override
@@ -118,9 +116,8 @@ public class JoinImpl extends SourceImpl
     }
 
     @Override
-    public void execute(String revisionId, NodeState root) {
+    public void execute(NodeState root) {
         this.root = root;
-        this.revisionId = revisionId;
         leftNeedExecute = true;
         end = false;
     }
@@ -131,7 +128,7 @@ public class JoinImpl extends SourceImpl
             return false;
         }
         if (leftNeedExecute) {
-            left.execute(revisionId, root);
+            left.execute(root);
             leftNeedExecute = false;
             leftNeedNext = true;
         }
@@ -145,7 +142,7 @@ public class JoinImpl extends SourceImpl
                 rightNeedExecute = true;
             }
             if (rightNeedExecute) {
-                right.execute(revisionId, root);
+                right.execute(root);
                 foundJoinedRow = false;
                 rightNeedExecute = false;
             }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
Mon Oct  1 12:54:46 2012
@@ -19,7 +19,6 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.JcrConstants;
-import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
@@ -27,6 +26,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.query.Query;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.spi.query.Cursor;
+import org.apache.jackrabbit.oak.spi.query.Filter;
 import org.apache.jackrabbit.oak.spi.query.IndexRow;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -77,7 +77,7 @@ public class SelectorImpl extends Source
 
 
     @Override
-    public void prepare(MicroKernel mk) {
+    public void prepare() {
         if (queryConstraint != null) {
             queryConstraint.restrictPushDown(this);
         }
@@ -88,8 +88,8 @@ public class SelectorImpl extends Source
     }
 
     @Override
-    public void execute(String revisionId, NodeState root) {
-        cursor = index.query(createFilter(), revisionId, root);
+    public void execute(NodeState root) {
+        cursor = index.query(createFilter(), root);
     }
 
     @Override
@@ -104,7 +104,7 @@ public class SelectorImpl extends Source
         return buff.toString();
     }
 
-    private FilterImpl createFilter() {
+    private Filter createFilter() {
         FilterImpl f = new FilterImpl(this);
         f.setNodeType(nodeTypeName);
         if (joinCondition != null) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
Mon Oct  1 12:54:46 2012
@@ -19,7 +19,7 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import java.util.ArrayList;
-import org.apache.jackrabbit.mk.api.MicroKernel;
+
 import org.apache.jackrabbit.oak.query.Query;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
@@ -134,17 +134,15 @@ public abstract class SourceImpl extends
     /**
      * Prepare executing the query. This method will decide which index to use.
      *
-     * @param mk the MicroKernel
      */
-    public abstract void prepare(MicroKernel mk);
+    public abstract void prepare();
 
     /**
      * Execute the query. The current node is set to before the first row.
      *
-     * @param revisionId the revision to use
      * @param root root state of the given revision
      */
-    public abstract void execute(String revisionId, NodeState root);
+    public abstract void execute(NodeState root);
 
     /**
      * Go to the next node for the given source. This will also filter the

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PrefixContentIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PrefixContentIndex.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PrefixContentIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PrefixContentIndex.java
Mon Oct  1 12:54:46 2012
@@ -33,6 +33,8 @@ import org.apache.jackrabbit.oak.spi.sta
 
 /**
  * An index that stores the index data in a {@code MicroKernel}.
+ * 
+ * @deprecated the revisionId info has been removed
  */
 public class PrefixContentIndex implements QueryIndex {
 
@@ -84,7 +86,7 @@ public class PrefixContentIndex implemen
     }
 
     @Override
-    public Cursor query(Filter filter, String revisionId, NodeState root) {
+    public Cursor query(Filter filter, NodeState root) {
         Filter.PropertyRestriction restriction = getPropertyTypeRestriction(filter);
         if (restriction == null) {
             throw new IllegalArgumentException("No restriction for *");
@@ -92,6 +94,8 @@ public class PrefixContentIndex implemen
         // TODO need to use correct json representation
         String v = restriction.first.getString();
         v = index.getPrefix() + v;
+        // TODO revisit code after the removal of revisionId
+        String revisionId = "";
         Iterator<String> it = index.getPaths(v, revisionId);
         return new ContentCursor(it);
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java
Mon Oct  1 12:54:46 2012
@@ -29,6 +29,8 @@ import org.apache.jackrabbit.oak.spi.sta
 
 /**
  * An index that stores the index data in a {@code MicroKernel}.
+ * 
+ * @deprecated the revisionId info has been removed
  */
 public class PropertyContentIndex implements QueryIndex {
 
@@ -61,7 +63,7 @@ public class PropertyContentIndex implem
     }
 
     @Override
-    public Cursor query(Filter filter, String revisionId, NodeState root) {
+    public Cursor query(Filter filter, NodeState root) {
         String propertyName = index.getPropertyName();
         Filter.PropertyRestriction restriction = filter.getPropertyRestriction(propertyName);
         if (restriction == null) {
@@ -69,6 +71,8 @@ public class PropertyContentIndex implem
         }
         CoreValue first = restriction.first;
         String f = first == null ? null : first.toString();
+        // TODO revisit code after the removal of revisionId
+        String revisionId = "";
         Iterator<String> it = index.getPaths(f, revisionId);
         return new ContentCursor(it);
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingIndex.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingIndex.java
Mon Oct  1 12:54:46 2012
@@ -30,7 +30,7 @@ import org.apache.jackrabbit.oak.spi.sta
 public class TraversingIndex implements QueryIndex {
 
     @Override
-    public Cursor query(Filter filter, String revisionId, NodeState root) {
+    public Cursor query(Filter filter, NodeState root) {
         return new TraversingCursor(filter, root);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java
Mon Oct  1 12:54:46 2012
@@ -55,11 +55,10 @@ public interface QueryIndex {
      * Start a query.
      *
      * @param filter the filter
-     * @param revisionId the revision
      * @param root root state of the given revision
      * @return a cursor to iterate over the result
      */
-    Cursor query(Filter filter, String revisionId, NodeState root);
+    Cursor query(Filter filter, NodeState root);
 
     /**
      * Get the query plan for the given filter.

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java
Mon Oct  1 12:54:46 2012
@@ -58,7 +58,7 @@ public class LuceneEditorTest implements
         filter.restrictPath("/", Filter.PathRestriction.EXACT);
         filter.restrictProperty("foo", Operator.EQUAL,
                 MemoryValueFactory.INSTANCE.createValue("bar"));
-        Cursor cursor = index.query(filter, null, store.getRoot());
+        Cursor cursor = index.query(filter, store.getRoot());
         assertTrue(cursor.next());
         assertEquals("/", cursor.currentRow().getPath());
         assertFalse(cursor.next());

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingCursorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingCursorTest.java?rev=1392308&r1=1392307&r2=1392308&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingCursorTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingCursorTest.java
Mon Oct  1 12:54:46 2012
@@ -63,7 +63,7 @@ public class TraversingCursorTest {
 
         f.setPath("/");
         List<String> paths = new ArrayList<String>();
-        Cursor c = t.query(f, head, new KernelNodeState(mk, "/", head, cache));
+        Cursor c = t.query(f, new KernelNodeState(mk, "/", head, cache));
         while (c.next()) {
             paths.add(c.currentRow().getPath());
         }
@@ -78,7 +78,7 @@ public class TraversingCursorTest {
         assertFalse(c.next());
 
         f.setPath("/nowhere");
-        c = t.query(f, head, new KernelNodeState(mk, "/", head, cache));
+        c = t.query(f, new KernelNodeState(mk, "/", head, cache));
         assertFalse(c.next());
         // endure it stays false
         assertFalse(c.next());



Mime
View raw message