ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/3] ignite git commit: Preparing.
Date Wed, 19 Apr 2017 16:37:37 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5033 [created] 35e9bbdb6


Preparing.


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

Branch: refs/heads/ignite-5033
Commit: 9f395ee52b7570b16d672de53581dc68060ad590
Parents: f923bc9
Author: devozerov <vozerov@gridgain.com>
Authored: Wed Apr 19 18:20:21 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Wed Apr 19 18:20:21 2017 +0300

----------------------------------------------------------------------
 .../DynamicIndexAbstractBasicSelfTest.java      | 60 ++++++++++++++------
 1 file changed, 42 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9f395ee5/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
index 6bc1576..7cb46b1 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
@@ -182,20 +182,18 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
     private void checkCreate(CacheMode mode, CacheAtomicityMode atomicityMode, boolean near)
throws Exception {
         initialize(mode, atomicityMode, near);
 
-        final IgniteEx node = node();
-
         final QueryIndex idx = index(IDX_NAME_1, field(FIELD_NAME_1));
 
-        queryProcessor(node).dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false).get();
+        dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false);
         assertIndex(CACHE_NAME, TBL_NAME, IDX_NAME_1, field(FIELD_NAME_1));
 
         assertSchemaException(new RunnableX() {
             @Override public void run() throws Exception {
-                queryProcessor(node).dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false).get();
+                dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false);
             }
         }, SchemaOperationException.CODE_INDEX_EXISTS);
 
-        queryProcessor(node).dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, true).get();
+        dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, true);
         assertIndex(CACHE_NAME, TBL_NAME, IDX_NAME_1, field(FIELD_NAME_1));
 
         assertSimpleIndexOperations(SQL_SIMPLE_FIELD_1);
@@ -270,7 +268,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
 
         final QueryIndex idx = index(IDX_NAME_1, field(FIELD_NAME_1), field(alias(FIELD_NAME_2)));
 
-        queryProcessor(node()).dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false).get();
+        dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false);
         assertIndex(CACHE_NAME, TBL_NAME, IDX_NAME_1, field(FIELD_NAME_1), field(alias(FIELD_NAME_2)));
 
         assertCompositeIndexOperations(SQL_COMPOSITE);
@@ -347,7 +345,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
 
         assertSchemaException(new RunnableX() {
             @Override public void run() throws Exception {
-                queryProcessor(node()).dynamicIndexCreate(randomString(), TBL_NAME, idx,
false).get();
+                dynamicIndexCreate(randomString(), TBL_NAME, idx, false);
             }
         }, SchemaOperationException.CODE_CACHE_NOT_FOUND);
 
@@ -423,7 +421,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
 
         assertSchemaException(new RunnableX() {
             @Override public void run() throws Exception {
-                queryProcessor(node()).dynamicIndexCreate(CACHE_NAME, randomString(), idx,
false).get();
+                dynamicIndexCreate(CACHE_NAME, randomString(), idx, false);
             }
         }, SchemaOperationException.CODE_TABLE_NOT_FOUND);
 
@@ -499,7 +497,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
 
         assertSchemaException(new RunnableX() {
             @Override public void run() throws Exception {
-                queryProcessor(node()).dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false).get();
+                dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false);
             }
         }, SchemaOperationException.CODE_COLUMN_NOT_FOUND);
 
@@ -576,7 +574,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
             @Override public void run() throws Exception {
                 QueryIndex idx = index(IDX_NAME_1, field(FIELD_NAME_2));
 
-                queryProcessor(node()).dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false).get();
+                dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false);
             }
         }, SchemaOperationException.CODE_COLUMN_NOT_FOUND);
 
@@ -584,7 +582,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
 
         QueryIndex idx = index(IDX_NAME_1, field(alias(FIELD_NAME_2)));
 
-        queryProcessor(node()).dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false).get();
+        dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false);
         assertIndex(CACHE_NAME, TBL_NAME, IDX_NAME_1, field(alias(FIELD_NAME_2)));
 
         assertSimpleIndexOperations(SQL_SIMPLE_FIELD_2);
@@ -659,7 +657,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
 
         QueryIndex idx = index(IDX_NAME_1, field(FIELD_NAME_1));
 
-        queryProcessor(node()).dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false).get();
+        dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, false);
         assertIndex(CACHE_NAME, TBL_NAME, IDX_NAME_1, field(FIELD_NAME_1));
 
         assertIndexUsed(IDX_NAME_1, SQL_SIMPLE_FIELD_1, SQL_ARG_1);
@@ -668,7 +666,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
 
         loadInitialData();
 
-        queryProcessor(node()).dynamicIndexDrop(CACHE_NAME, IDX_NAME_1, false).get();
+        dynamicIndexDrop(CACHE_NAME, IDX_NAME_1, false);
         assertNoIndex(CACHE_NAME, TBL_NAME, IDX_NAME_1);
 
         assertSimpleIndexOperations(SQL_SIMPLE_FIELD_1);
@@ -743,11 +741,11 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
 
         assertSchemaException(new RunnableX() {
             @Override public void run() throws Exception {
-                queryProcessor(node()).dynamicIndexDrop(CACHE_NAME, IDX_NAME_1, false).get();
+                dynamicIndexDrop(CACHE_NAME, IDX_NAME_1, false);
             }
         }, SchemaOperationException.CODE_INDEX_NOT_FOUND);
 
-        queryProcessor(node()).dynamicIndexDrop(CACHE_NAME, IDX_NAME_1, true).get();
+        dynamicIndexDrop(CACHE_NAME, IDX_NAME_1, true);
         assertNoIndex(CACHE_NAME, TBL_NAME, IDX_NAME_1);
     }
 
@@ -820,7 +818,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
 
         assertSchemaException(new RunnableX() {
             @Override public void run() throws Exception {
-                queryProcessor(node()).dynamicIndexDrop(randomString(), "my_idx", false).get();
+                dynamicIndexDrop(randomString(), "my_idx", false);
             }
         }, SchemaOperationException.CODE_CACHE_NOT_FOUND);
 
@@ -842,7 +840,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
 
         assertSchemaException(new RunnableX() {
             @Override public void run() throws Exception {
-                queryProcessor(node()).dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, true).get();
+                dynamicIndexCreate(CACHE_NAME, TBL_NAME, idx, true);
             }
         }, SchemaOperationException.CODE_GENERIC);
 
@@ -850,7 +848,7 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
 
         assertSchemaException(new RunnableX() {
             @Override public void run() throws Exception {
-                queryProcessor(node()).dynamicIndexDrop(CACHE_NAME, IDX_NAME_1, true).get();
+                dynamicIndexDrop(CACHE_NAME, IDX_NAME_1, true);
             }
         }, SchemaOperationException.CODE_GENERIC);
     }
@@ -947,4 +945,30 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
         for (Ignite node : Ignition.allGrids())
             assertSqlCompositeData(node, sql, 0);
     }
+
+    /**
+     * Synchronously create index.
+     *
+     * @param space Space.
+     * @param tblName Table name.
+     * @param idx Index.
+     * @param ifNotExists When set to true operation will fail if index already exists.
+     * @throws Exception If failed.
+     */
+    private void dynamicIndexCreate(String space, String tblName, QueryIndex idx, boolean
ifNotExists)
+        throws Exception {
+        queryProcessor(node()).dynamicIndexCreate(space, tblName, idx, ifNotExists).get();
+    }
+
+    /**
+     * Synchronously drop index.
+     *
+     * @param space Space.
+     * @param idxName Index name.
+     * @param ifExists When set to true operation fill fail if index doesn't exists.
+     * @throws Exception if failed.
+     */
+    private void dynamicIndexDrop(String space, String idxName, boolean ifExists) throws
Exception {
+        queryProcessor(node()).dynamicIndexDrop(space, idxName, ifExists).get();
+    }
 }


Mime
View raw message