Author: thomasm
Date: Wed Mar 12 10:37:58 2014
New Revision: 1576684

URL: http://svn.apache.org/r1576684
Log:
OAK-1531 OrderedPropertyIndex logs many warnings

Modified:
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndex.java

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndex.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndex.java?rev=1576684&r1=1576683&r2=1576684&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndex.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndex.java
 Wed Mar 12 10:37:58 2014
@@ -28,7 +28,11 @@ import org.slf4j.LoggerFactory;
  * A property index that supports ordering keys.
  */
 public class OrderedPropertyIndex extends PropertyIndex {
+    
     private static final Logger LOG = 
LoggerFactory.getLogger(OrderedPropertyIndex.class);
+    
+    private static boolean warned;
+    
     @Override
     public String getIndexName() {
         return TYPE;
@@ -42,7 +46,10 @@ public class OrderedPropertyIndex extend
     @Override
     public double getCost(Filter filter, NodeState root) {
         //we don't want the index to be used yet
-        LOG.warn("this index will always return Double.POSITIVE_INFINITY and 
therefore never work");
+        if (!warned) {
+            warned = true;
+            LOG.warn("This index always returns Double.POSITIVE_INFINITY and 
is therefore never used");
+        }
         return Double.POSITIVE_INFINITY;
     }
 }


Reply via email to