jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1421350 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: plugins/index/nodetype/ plugins/index/old/ plugins/index/p2/ plugins/index/property/ query/
Date Thu, 13 Dec 2012 15:52:21 GMT
Author: thomasm
Date: Thu Dec 13 15:52:19 2012
New Revision: 1421350

URL: http://svn.apache.org/viewvc?rev=1421350&view=rev
Log:
OAK-425 Query: improved logging (use +Inf instead of Double.MAX_VALUE)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndex.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/p2/Property2Index.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2IndexLookup.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/plugins/index/property/PropertyIndexLookup.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndex.java?rev=1421350&r1=1421349&r2=1421350&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndex.java
Thu Dec 13 15:52:19 2012
@@ -53,13 +53,13 @@ class NodeTypeIndex implements QueryInde
         if (!hasNodeTypeRestriction(filter)) {
             // this is not an appropriate index if the filter
             // doesn't have a node type restriction
-            return Double.MAX_VALUE;
+            return Double.POSITIVE_INFINITY;
         }
         NodeTypeIndexLookup lookup = new NodeTypeIndexLookup(root);
         if (lookup.isIndexed(filter.getPath())) {
             return lookup.getCost(resolveNodeType(root, filter.getNodeType()));
         } else {
-            return Double.MAX_VALUE;
+            return Double.POSITIVE_INFINITY;
         }
     }
 

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=1421350&r1=1421349&r2=1421350&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 Dec 13 15:52:19 2012
@@ -51,7 +51,7 @@ public class PrefixContentIndex implemen
         if (getPropertyTypeRestriction(filter) != null) {
             return 100;
         }
-        return Double.MAX_VALUE;
+        return Double.POSITIVE_INFINITY;
     }
 
     private Filter.PropertyRestriction getPropertyTypeRestriction(Filter filter) {

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=1421350&r1=1421349&r2=1421350&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 Dec 13 15:52:19 2012
@@ -48,11 +48,11 @@ public class PropertyContentIndex implem
         String propertyName = index.getPropertyName();
         Filter.PropertyRestriction restriction = filter.getPropertyRestriction(propertyName);
         if (restriction == null) {
-            return Double.MAX_VALUE;
+            return Double.POSITIVE_INFINITY;
         }
         if (restriction.first != restriction.last) {
             // only support equality matches (for now)
-            return Double.MAX_VALUE;
+            return Double.POSITIVE_INFINITY;
         }
         boolean unique = index.isUnique();
         return unique ? 2 : 20;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2Index.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2Index.java?rev=1421350&r1=1421349&r2=1421350&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2Index.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2Index.java
Thu Dec 13 15:52:19 2012
@@ -117,7 +117,7 @@ class Property2Index implements QueryInd
             }
         }
         // not an appropriate index
-        return Double.MAX_VALUE;
+        return Double.POSITIVE_INFINITY;
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2IndexLookup.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2IndexLookup.java?rev=1421350&r1=1421349&r2=1421350&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2IndexLookup.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2IndexLookup.java
Thu Dec 13 15:52:19 2012
@@ -173,7 +173,7 @@ public class Property2IndexLookup {
                 }
             }
         } else {
-            cost = Double.MAX_VALUE;
+            cost = Double.POSITIVE_INFINITY;
         }
         return cost;
     }

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=1421350&r1=1421349&r2=1421350&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 Dec 13 15:52:19 2012
@@ -118,7 +118,7 @@ class PropertyIndex implements QueryInde
             }
         }
         // not an appropriate index
-        return Double.MAX_VALUE;
+        return Double.POSITIVE_INFINITY;
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java?rev=1421350&r1=1421349&r2=1421350&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
Thu Dec 13 15:52:19 2012
@@ -173,7 +173,7 @@ public class PropertyIndexLookup {
                 }
             }
         } else {
-            cost = Double.MAX_VALUE;
+            cost = Double.POSITIVE_INFINITY;
         }
         return cost;
     }

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=1421350&r1=1421349&r2=1421350&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 Dec 13 15:52:19 2012
@@ -156,7 +156,7 @@ public abstract class QueryEngineImpl im
 
     public QueryIndex getBestIndex(Query query, NodeState rootState, Filter filter) {
         QueryIndex best = null;
-        double bestCost = Double.MAX_VALUE;
+        double bestCost = Double.POSITIVE_INFINITY;
         for (QueryIndex index : getIndexes(rootState)) {
             double cost = index.getCost(filter, rootState);
             if (LOG.isDebugEnabled()) {



Mime
View raw message