ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [04/38] incubator-ignite git commit: sprint-6 - ignite-indexing module check
Date Mon, 22 Jun 2015 09:05:01 GMT
sprint-6 - ignite-indexing module check


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c1eee186
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c1eee186
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c1eee186

Branch: refs/heads/ignite-yardstick-client
Commit: c1eee18615be56c7bb60d34614451612710b6cef
Parents: d874b00
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Thu Jun 18 13:39:19 2015 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Thu Jun 18 13:39:19 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/IgniteCacheProxy.java    | 5 +++++
 .../ignite/internal/processors/query/GridQueryProcessor.java  | 7 +++++++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1eee186/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 0d70792..48fd259 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -556,6 +556,11 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
             !(qry instanceof ContinuousQuery))
             throw new CacheException("Indexing is disabled for cache: " + ctx.cache().name()
+
                 ". Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to
enable.");
+
+        if (!ctx.kernalContext().query().moduleEnabled() &&
+            (qry instanceof SqlQuery || qry instanceof SqlFieldsQuery || qry instanceof TextQuery))
+            throw new CacheException("Failed to execute query. Add module 'ignite-indexing'
to the classpath " +
+                "of all Ignite nodes.");
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1eee186/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 4f2486b..e080c6d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -107,6 +107,13 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     }
 
     /**
+     * @return {@code true} If indexing module is in classpath and successfully initialized.
+     */
+    public boolean moduleEnabled() {
+        return idx != null;
+    }
+
+    /**
      * @param ccfg Cache configuration.
      * @throws IgniteCheckedException If failed.
      */


Mime
View raw message