jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1481845 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/query/ main/java/org/apache/jackrabbit/oak/spi/query/ test/resources/org/apache/jackrabbit/oak/query/
Date Mon, 13 May 2013 13:35:54 GMT
Author: thomasm
Date: Mon May 13 13:35:53 2013
New Revision: 1481845

URL: http://svn.apache.org/r1481845
Log:
OAK-28 Query implementation: code cleanup

Modified:
    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/SQL2Parser.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Filter.java
    jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_explain.txt

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=1481845&r1=1481844&r2=1481845&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 May 13 13:35:53 2013
@@ -52,15 +52,22 @@ public abstract class QueryEngineImpl im
 
     static final String NO_LITERALS = "-noLiterals";
 
+    static final Logger LOG = LoggerFactory.getLogger(QueryEngineImpl.class);
+    
     private static final Set<String> SUPPORTED_LANGUAGES = of(
             SQL2,  SQL2  + NO_LITERALS,
             SQL,   SQL   + NO_LITERALS,
             XPATH, XPATH + NO_LITERALS,
             JQOM);
 
-    static final Logger LOG = LoggerFactory.getLogger(QueryEngineImpl.class);
-
     private final QueryIndexProvider indexProvider;
+    
+    /**
+     * Whether fallback to the traversing index is supported if no other index
+     * is available. This is enabled by default and can be disabled for testing
+     * purposes.
+     */
+    private boolean traversalFallback = true;
 
     public QueryEngineImpl(QueryIndexProvider indexProvider) {
         this.indexProvider = indexProvider;
@@ -155,11 +162,6 @@ public abstract class QueryEngineImpl im
         return q.executeQuery();
     }
 
-    /**
-     * testing purposes only
-     */
-    private boolean traversalFallback = true;
-
     protected void setTravesalFallback(boolean traversal) {
         this.traversalFallback = traversal;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java?rev=1481845&r1=1481844&r2=1481845&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
Mon May 13 13:35:53 2013
@@ -98,7 +98,8 @@ public class SQL2Parser {
 
     /**
      * Create a new parser. A parser can be re-used, but it is not thread safe.
-     *
+     * 
+     * @param types the node with the node type information
      */
     public SQL2Parser(NodeState types) {
         this.types = checkNotNull(types);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Filter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Filter.java?rev=1481845&r1=1481844&r2=1481845&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Filter.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Filter.java
Mon May 13 13:35:53 2013
@@ -108,14 +108,6 @@ public interface Filter {
     Set<String> getMixinTypes();
 
     /**
-     * Get the node type.
-     * 
-     * @return the node type restriction or <code>null</code> if none is set.
-     */
-//    @CheckForNull
-//    String getNodeType();
-
-    /**
      * Get the complete query statement. The statement should only be used for
      * logging purposes.
      * 

Modified: jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_explain.txt
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_explain.txt?rev=1481845&r1=1481844&r2=1481845&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_explain.txt
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2_explain.txt
Mon May 13 13:35:53 2013
@@ -23,6 +23,8 @@
 # * new tests are typically be added on top, after the syntax docs
 # * use ascii character only
 
+# TODO current not used, as property and prefix indexes are no longer supported
+
 # property type (value prefix) index
 
 commit / + "test": { "a": { "id": "ref:123" }, "b": { "id" : "str:123" }}



Mime
View raw message