jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1393959 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: osgi/ plugins/index/ plugins/lucene/ query/ spi/query/
Date Thu, 04 Oct 2012 08:58:16 GMT
Author: alexparvulescu
Date: Thu Oct  4 08:58:16 2012
New Revision: 1393959

URL: http://svn.apache.org/viewvc?rev=1393959&view=rev
Log:
OAK-297 QueryIndexProvider should use NodeState

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiIndexProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndexer.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndexProvider.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/spi/query/CompositeQueryIndexProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexUtils.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndexProvider.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiIndexProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiIndexProvider.java?rev=1393959&r1=1393958&r2=1393959&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiIndexProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiIndexProvider.java
Thu Oct  4 08:58:16 2012
@@ -25,7 +25,7 @@ import javax.annotation.Nonnull;
 import org.apache.jackrabbit.oak.spi.query.CompositeQueryIndexProvider;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
-import org.apache.jackrabbit.oak.spi.state.NodeStore;
+import org.apache.jackrabbit.oak.spi.state.NodeState;
 
 /**
  * This index provider combines all indexes of all available OSGi index
@@ -40,10 +40,10 @@ public class OsgiIndexProvider
     }
 
     @Override @Nonnull
-    public List<? extends QueryIndex> getQueryIndexes(NodeStore nodeStore) {
+    public List<? extends QueryIndex> getQueryIndexes(NodeState nodeState) {
         QueryIndexProvider composite =
                 CompositeQueryIndexProvider.compose(getServices());
-        return composite.getQueryIndexes(nodeStore);
+        return composite.getQueryIndexes(nodeState);
     }
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndexer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndexer.java?rev=1393959&r1=1393958&r2=1393959&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndexer.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndexer.java
Thu Oct  4 08:58:16 2012
@@ -32,7 +32,6 @@ import org.apache.jackrabbit.oak.spi.que
 import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStore;
 
 public class PropertyIndexer implements QueryIndexProvider, CommitHook,
         PropertyIndexConstants {
@@ -53,12 +52,12 @@ public class PropertyIndexer implements 
     }
 
     @Override @Nonnull
-    public List<? extends QueryIndex> getQueryIndexes(NodeStore store) {
+    public List<? extends QueryIndex> getQueryIndexes(NodeState nodeState) {
         List<QueryIndex> queryIndexList = new ArrayList<QueryIndex>();
-        NodeBuilder rootBuilder = IndexUtils.getChildBuilder(store,
+        NodeBuilder rootBuilder = IndexUtils.getChildBuilder(nodeState,
                 indexConfigPath);
         List<IndexDefinition> indexDefinitions = IndexUtils
-                .buildIndexDefinitions(store.getRoot(), indexConfigPath,
+                .buildIndexDefinitions(nodeState, indexConfigPath,
                         INDEX_TYPE_PROPERTY);
         for (IndexDefinition def : indexDefinitions) {
             NodeBuilder builder = rootBuilder.getChildBuilder(def.getName());

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndexProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndexProvider.java?rev=1393959&r1=1393958&r2=1393959&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndexProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndexProvider.java
Thu Oct  4 08:58:16 2012
@@ -27,7 +27,7 @@ import org.apache.jackrabbit.oak.spi.que
 import org.apache.jackrabbit.oak.spi.query.IndexUtils;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
-import org.apache.jackrabbit.oak.spi.state.NodeStore;
+import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -47,14 +47,14 @@ public class LuceneIndexProvider impleme
     }
 
     @Override @Nonnull
-    public List<QueryIndex> getQueryIndexes(NodeStore store) {
+    public List<QueryIndex> getQueryIndexes(NodeState nodeState) {
         if (!PathUtils.isValid(indexPath)) {
             LOG.warn("index path is not valid {}", indexPath);
             return Collections.<QueryIndex> emptyList();
         }
         List<QueryIndex> tempIndexes = new ArrayList<QueryIndex>();
         for (IndexDefinition child : IndexUtils.buildIndexDefinitions(
-                store.getRoot(), indexPath, TYPE)) {
+                nodeState, indexPath, TYPE)) {
             LOG.debug("found a lucene index definition {}", child);
             tempIndexes.add(new LuceneIndex(child));
         }

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=1393959&r1=1393958&r2=1393959&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
Thu Oct  4 08:58:16 2012
@@ -128,7 +128,7 @@ public class QueryEngineImpl {
     }
 
     private List<? extends QueryIndex> getIndexes() {
-        return indexProvider.getQueryIndexes(store);
+        return indexProvider.getQueryIndexes(store.getRoot());
     }
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/CompositeQueryIndexProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/CompositeQueryIndexProvider.java?rev=1393959&r1=1393958&r2=1393959&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/CompositeQueryIndexProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/CompositeQueryIndexProvider.java
Thu Oct  4 08:58:16 2012
@@ -22,7 +22,7 @@ import java.util.List;
 
 import javax.annotation.Nonnull;
 
-import org.apache.jackrabbit.oak.spi.state.NodeStore;
+import org.apache.jackrabbit.oak.spi.state.NodeState;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
@@ -39,7 +39,7 @@ public class CompositeQueryIndexProvider
         if (providers.isEmpty()) {
             return new QueryIndexProvider() {
                 @Override
-                public List<QueryIndex> getQueryIndexes(NodeStore nodeStore) {
+                public List<QueryIndex> getQueryIndexes(NodeState nodeState) {
                     return ImmutableList.of();
                 }
             };
@@ -62,10 +62,10 @@ public class CompositeQueryIndexProvider
     }
 
     @Override @Nonnull
-    public List<? extends QueryIndex> getQueryIndexes(NodeStore nodeStore) {
+    public List<? extends QueryIndex> getQueryIndexes(NodeState nodeState) {
         List<QueryIndex> indexes = Lists.newArrayList();
         for (QueryIndexProvider provider : providers) {
-            indexes.addAll(provider.getQueryIndexes(nodeStore));
+            indexes.addAll(provider.getQueryIndexes(nodeState));
         }
         return indexes;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexUtils.java?rev=1393959&r1=1393958&r2=1393959&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexUtils.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexUtils.java
Thu Oct  4 08:58:16 2012
@@ -33,7 +33,6 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStore;
 
 public class IndexUtils {
 
@@ -125,12 +124,7 @@ public class IndexUtils {
         return defs;
     }
 
-    public static NodeBuilder getChildBuilder(NodeStore store, String path) {
-        return getChildBuilder(store, store.getRoot(), path);
-    }
-
-    public static NodeBuilder getChildBuilder(NodeStore store, NodeState state,
-            String path) {
+    public static NodeBuilder getChildBuilder(NodeState state, String path) {
         NodeBuilder builder = state.getBuilder();
         for (String p : PathUtils.elements(path)) {
             builder = builder.getChildBuilder(p);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndexProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndexProvider.java?rev=1393959&r1=1393958&r2=1393959&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndexProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndexProvider.java
Thu Oct  4 08:58:16 2012
@@ -22,7 +22,7 @@ import java.util.List;
 
 import javax.annotation.Nonnull;
 
-import org.apache.jackrabbit.oak.spi.state.NodeStore;
+import org.apache.jackrabbit.oak.spi.state.NodeState;
 
 /**
  * A mechanism to index data. Indexes might be added or removed at runtime,
@@ -37,6 +37,6 @@ public interface QueryIndexProvider {
      * @return the list of indexes
      */
     @Nonnull
-    List<? extends QueryIndex> getQueryIndexes(NodeStore nodeStore);
+    List<? extends QueryIndex> getQueryIndexes(NodeState nodeState);
 
 }



Mime
View raw message