#sprint-2-tests: Revert check for query index enable in IgfsProcessor.

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

Branch: refs/heads/ignite-409
Commit: a6f75cdc09d0cc19f56a77bb9dd7002af36b6788
Parents: 1401330
Author: ivasilinets <ivasilin...@gridgain.com>
Authored: Wed Mar 18 16:41:55 2015 +0300
Committer: ivasilinets <ivasilin...@gridgain.com>
Committed: Wed Mar 18 16:41:55 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/igfs/IgfsProcessor.java |  7 ++++++
 .../igfs/IgfsProcessorValidationSelfTest.java   | 26 ++++++++++++++++++++
 2 files changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a6f75cdc/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
index db550c3..f1e5918 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
@@ -267,11 +267,18 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
             if (dataCache == null)
                 throw new IgniteCheckedException("Data cache is not configured 
locally for IGFS: " + cfg);
 
+            if (dataCache.configuration().getIndexedTypes() != null)
+                throw new IgniteCheckedException("IGFS data cache cannot start 
with enabled query indexing.");
+
             GridCache<Object, Object> metaCache = 
ctx.cache().cache(cfg.getMetaCacheName());
 
             if (metaCache == null)
                 throw new IgniteCheckedException("Metadata cache is not 
configured locally for IGFS: " + cfg);
 
+            if (metaCache.configuration().getIndexedTypes() != null)
+                throw new IgniteCheckedException("IGFS metadata cache cannot 
start with enabled query indexing.");
+
+
             if (F.eq(cfg.getDataCacheName(), cfg.getMetaCacheName()))
                 throw new IgniteCheckedException("Cannot use same cache as 
both data and meta cache: " + cfg.getName());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a6f75cdc/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
index 82633d6..099f681 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
@@ -181,6 +181,32 @@ public class IgfsProcessorValidationSelfTest extends 
IgfsCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
+    public void testLocalIfQueryIndexingEnabledForDataCache() throws Exception 
{
+        CacheConfiguration[] dataCaches = dataCaches(1024);
+
+        dataCaches[0].setIndexedTypes(Integer.class, String.class);
+
+        g1Cfg.setCacheConfiguration(concat(dataCaches, metaCaches(), 
CacheConfiguration.class));
+
+        checkGridStartFails(g1Cfg, "IGFS data cache cannot start with enabled 
query indexing", true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testLocalIfQueryIndexingEnabledForMetaCache() throws Exception 
{
+        CacheConfiguration[] metaCaches = metaCaches();
+
+        metaCaches[0].setIndexedTypes(Integer.class, String.class);
+
+        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches, 
CacheConfiguration.class));
+
+        checkGridStartFails(g1Cfg, "IGFS metadata cache cannot start with 
enabled query indexing", true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     @SuppressWarnings("NullableProblems")
     public void testLocalNullIgfsNameIsSupported() throws Exception {
         g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), 
CacheConfiguration.class));

Reply via email to