ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] agura commented on a change in pull request #5676: IGNITE-10654 Print warn message in case of index creating with already existing fields.
Date Tue, 30 Jul 2019 11:37:43 GMT
agura commented on a change in pull request #5676: IGNITE-10654 Print warn message in case
of index creating with already existing fields.
URL: https://github.com/apache/ignite/pull/5676#discussion_r308666142
 
 

 ##########
 File path: modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java
 ##########
 @@ -209,6 +256,427 @@ public void testDynamicIndexesNoPersistence() throws Exception {
         }
     }
 
+    /**
+     * Test mixed dynamic and static caches with indexes creation.
+     *
+     * @throws Exception If failed.
+     */
+    @Test
+    public void testDynamicIdxOnStaticCacheWithIdxWithoutPersistence() throws Exception {
+        runDynamicIdxOnStaticCacheWithIdx(false);
+    }
+
+    /**
+     * Test mixed dynamic and static caches with indexes creation.
+     *
+     * @throws Exception If failed.
+     */
+    @Test
+    public void testDynamicIdxOnStaticCacheWithIdxWithPersistence() throws Exception {
+        runDynamicIdxOnStaticCacheWithIdx(true);
+    }
+
+    /** */
+    private void runDynamicIdxOnStaticCacheWithIdx(boolean persistEnabled) throws Exception
{
+        isPersistenceEnabled = persistEnabled;
+
+        inlineSize = 10;
+
+        createIdx = false;
+
+        indexes = Collections.singletonList(new QueryIndex("valStr"));
+
+        IgniteEx ig0 = startGrid(0);
+
+        createIdx = true;
+
+        startGrid(1);
+
+        if (persistEnabled)
+            ig0.cluster().active(true);
+
+        IgniteCache<Key, Val> cache = grid(0).cache(DEFAULT_CACHE_NAME);
+
+        populateCache();
+
+        String plan = cache.query(new SqlFieldsQuery("explain select * from Val where valStr
between 0 and ?")
+            .setArgs(100)).getAll().get(0).get(0).toString();
+
+        assertTrue(plan, plan.contains(SCAN_INDEX_NAME_SUFFIX));
+
+        stopAllGrids();
+
+        if (persistEnabled)
+            cleanPersistenceDir();
+
+        createStaticCache = false;
+
+        ig0 = startGrid(0);
+
+        if (persistEnabled)
+            ig0.cluster().active(true);
+
+        ig0.getOrCreateCache(DEFAULT_CACHE_NAME);
+
+        populateCache();
+
+        createStaticCache = true;
+
+        try {
+            startGrid(1);
+
+            fail("Exception wasn't thrown");
+        } catch (IgniteCheckedException e) {
 
 Review comment:
   `catch` must be on the next line.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message