jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1404603 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: plugins/index/lucene/ plugins/index/old/ plugins/index/property/ query/ query/index/ spi/query/
Date Thu, 01 Nov 2012 14:08:47 GMT
Author: mreutegg
Date: Thu Nov  1 14:08:47 2012
New Revision: 1404603

URL: http://svn.apache.org/viewvc?rev=1404603&view=rev
Log:
OAK-415: Add root NodeState param to QueryIndex.getCost()

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PrefixContentIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndex.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/index/TraversingIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java?rev=1404603&r1=1404602&r2=1404603&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java
Thu Nov  1 14:08:47 2012
@@ -118,7 +118,8 @@ public class LuceneIndex implements Quer
     }
 
     @Override
-    public double getCost(Filter filter) {
+    public double getCost(Filter filter, NodeState root) {
+        // TODO: proper cost calculation
         return 1.0;
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PrefixContentIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PrefixContentIndex.java?rev=1404603&r1=1404602&r2=1404603&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PrefixContentIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PrefixContentIndex.java
Thu Nov  1 14:08:47 2012
@@ -46,7 +46,7 @@ public class PrefixContentIndex implemen
     }
 
     @Override
-    public double getCost(Filter filter) {
+    public double getCost(Filter filter, NodeState root) {
         if (getPropertyTypeRestriction(filter) != null) {
             return 100;
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java?rev=1404603&r1=1404602&r2=1404603&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java
Thu Nov  1 14:08:47 2012
@@ -43,7 +43,7 @@ public class PropertyContentIndex implem
     }
 
     @Override
-    public double getCost(Filter filter) {
+    public double getCost(Filter filter, NodeState root) {
         String propertyName = index.getPropertyName();
         Filter.PropertyRestriction restriction = filter.getPropertyRestriction(propertyName);
         if (restriction == null) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndex.java?rev=1404603&r1=1404602&r2=1404603&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndex.java
Thu Nov  1 14:08:47 2012
@@ -112,8 +112,9 @@ public class PropertyIndex implements Qu
     }
 
     @Override
-    public double getCost(Filter filter) {
-        return 1.0; // FIXME: proper cost calculation
+    public double getCost(Filter filter, NodeState root) {
+        // TODO: proper cost calculation
+        return 1.0;
     }
 
     @Override

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=1404603&r1=1404602&r2=1404603&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 Nov  1 14:08:47 2012
@@ -113,7 +113,7 @@ public class QueryEngineImpl {
         QueryIndex best = null;
         double bestCost = Double.MAX_VALUE;
         for (QueryIndex index : getIndexes()) {
-            double cost = index.getCost(filter);
+            double cost = index.getCost(filter, root);
             if (cost < bestCost) {
                 bestCost = cost;
                 best = index;

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=1404603&r1=1404602&r2=1404603&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
Thu Nov  1 14:08:47 2012
@@ -35,7 +35,7 @@ public class TraversingIndex implements 
     }
 
     @Override
-    public double getCost(Filter filter) {
+    public double getCost(Filter filter, NodeState root) {
         String path = filter.getPath();
         // TODO estimate or read the node count
         double nodeCount = 10000000;

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=1404603&r1=1404602&r2=1404603&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
Thu Nov  1 14:08:47 2012
@@ -47,9 +47,10 @@ public interface QueryIndex {
      * estimated number of nodes to traverse.
      *
      * @param filter the filter
+     * @param root root state of the current repository snapshot
      * @return the estimated cost in number of read nodes
      */
-    double getCost(Filter filter);
+    double getCost(Filter filter, NodeState root);
 
     /**
      * Start a query.



Mime
View raw message