ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/9] ignite git commit: ignite-db-x fix testBackUpFail, close tcp port if fail on start, refactoring odbc test, fix testParallelLoad, testLoadCache for binary mode.
Date Mon, 30 Jan 2017 17:47:14 GMT
ignite-db-x fix testBackUpFail, close tcp port if fail on start, refactoring odbc test, fix
testParallelLoad, testLoadCache  for binary mode.


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

Branch: refs/heads/ignite-3477-freelist
Commit: 0e78dd1dd4e039dcf1ec094e1c84733529d6fedc
Parents: ad06102
Author: Dmitriy Govorukhin <dgovorukhin@gridgain.com>
Authored: Fri Jan 27 16:18:12 2017 +0300
Committer: Dmitriy Govorukhin <dgovorukhin@gridgain.com>
Committed: Fri Jan 27 16:18:12 2017 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 61 +++++++++++---------
 .../store/jdbc/CacheJdbcPojoStoreTest.java      | 13 +++++
 ...artitionedBackupNodeFailureRecoveryTest.java | 12 +++-
 .../odbc/OdbcProcessorValidationSelfTest.java   |  9 ++-
 4 files changed, 66 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0e78dd1d/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index c280b30..c11b770 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -880,37 +880,44 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
             // Start processors before discovery manager, so they will
             // be able to start receiving messages once discovery completes.
-            startProcessor(createComponent(DiscoveryNodeValidationProcessor.class, ctx));
-            startProcessor(new GridClockSyncProcessor(ctx));
-            startProcessor(new GridAffinityProcessor(ctx));
-            startProcessor(createComponent(GridSegmentationProcessor.class, ctx));
-            startProcessor(createComponent(IgniteCacheObjectProcessor.class, ctx));
-            startProcessor(new GridCacheProcessor(ctx));
-            startProcessor(new GridClusterStateProcessor(ctx));
-            startProcessor(new GridQueryProcessor(ctx));
-            startProcessor(new OdbcProcessor(ctx));
-            startProcessor(new GridServiceProcessor(ctx));
-            startProcessor(new GridTaskSessionProcessor(ctx));
-            startProcessor(new GridJobProcessor(ctx));
-            startProcessor(new GridTaskProcessor(ctx));
-            startProcessor((GridProcessor)SCHEDULE.createOptional(ctx));
-            startProcessor(new GridRestProcessor(ctx));
-            startProcessor(new DataStreamProcessor(ctx));
-            startProcessor((GridProcessor)IGFS.create(ctx, F.isEmpty(cfg.getFileSystemConfiguration())));
-            startProcessor(new GridContinuousProcessor(ctx));
-            startProcessor(createHadoopComponent());
-            startProcessor(new DataStructuresProcessor(ctx));
-            startProcessor(createComponent(PlatformProcessor.class, ctx));
+            try {
+                startProcessor(createComponent(DiscoveryNodeValidationProcessor.class, ctx));
+                startProcessor(new GridClockSyncProcessor(ctx));
+                startProcessor(new GridAffinityProcessor(ctx));
+                startProcessor(createComponent(GridSegmentationProcessor.class, ctx));
+                startProcessor(createComponent(IgniteCacheObjectProcessor.class, ctx));
+                startProcessor(new GridCacheProcessor(ctx));
+                startProcessor(new GridClusterStateProcessor(ctx));
+                startProcessor(new GridQueryProcessor(ctx));
+                startProcessor(new OdbcProcessor(ctx));
+                startProcessor(new GridServiceProcessor(ctx));
+                startProcessor(new GridTaskSessionProcessor(ctx));
+                startProcessor(new GridJobProcessor(ctx));
+                startProcessor(new GridTaskProcessor(ctx));
+                startProcessor((GridProcessor)SCHEDULE.createOptional(ctx));
+                startProcessor(new GridRestProcessor(ctx));
+                startProcessor(new DataStreamProcessor(ctx));
+                startProcessor((GridProcessor)IGFS.create(ctx, F.isEmpty(cfg.getFileSystemConfiguration())));
+                startProcessor(new GridContinuousProcessor(ctx));
+                startProcessor(createHadoopComponent());
+                startProcessor(new DataStructuresProcessor(ctx));
+                startProcessor(createComponent(PlatformProcessor.class, ctx));
+
+                // Start plugins.
+                for (PluginProvider provider : ctx.plugins().allProviders()) {
+                    ctx.add(new GridPluginComponent(provider));
+
+                    provider.start(ctx.plugins().pluginContextForProvider(provider));
+                }
 
-            // Start plugins.
-            for (PluginProvider provider : ctx.plugins().allProviders()) {
-                ctx.add(new GridPluginComponent(provider));
+                fillNodeAttributes(clusterProc.updateNotifierEnabled());
+            }catch (Throwable e) {
+                // Stop discovery spi to close tcp socket.
+                ctx.discovery().stop(true);
 
-                provider.start(ctx.plugins().pluginContextForProvider(provider));
+                throw e;
             }
 
-            fillNodeAttributes(clusterProc.updateNotifierEnabled());
-
             gw.writeLock();
 
             try {

http://git-wip-us.apache.org/repos/asf/ignite/blob/0e78dd1d/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
index 4a0b1da..be38541 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
@@ -29,6 +29,7 @@ import java.util.UUID;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import javax.cache.integration.CacheWriterException;
 
+import org.apache.ignite.binary.BinaryObject;
 import org.apache.ignite.cache.store.jdbc.dialect.H2Dialect;
 import org.apache.ignite.cache.store.jdbc.model.Organization;
 import org.apache.ignite.cache.store.jdbc.model.OrganizationKey;
@@ -295,6 +296,12 @@ public class CacheJdbcPojoStoreTest extends GridAbstractCacheStoreSelfTest<Cache
 
         IgniteBiInClosure<Object, Object> c = new CI2<Object, Object>() {
             @Override public void apply(Object k, Object v) {
+                if (k instanceof BinaryObject)
+                    k = ((BinaryObject)k).deserialize();
+
+                if (v instanceof BinaryObject)
+                    v = ((BinaryObject)k).deserialize();
+
                 if (k instanceof OrganizationKey && v instanceof Organization)
                     orgKeys.add((OrganizationKey)k);
                 else if (k instanceof PersonKey && v instanceof Person)
@@ -381,6 +388,12 @@ public class CacheJdbcPojoStoreTest extends GridAbstractCacheStoreSelfTest<Cache
 
         IgniteBiInClosure<Object, Object> c = new CI2<Object, Object>() {
             @Override public void apply(Object k, Object v) {
+                if (k instanceof BinaryObject)
+                    k = ((BinaryObject)k).deserialize();
+
+                if (v instanceof BinaryObject)
+                    v = ((BinaryObject)k).deserialize();
+
                 if (k instanceof PersonComplexKey && v instanceof Person)
                     prnComplexKeys.add((PersonComplexKey)k);
                 else

http://git-wip-us.apache.org/repos/asf/ignite/blob/0e78dd1d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedBackupNodeFailureRecoveryTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedBackupNodeFailureRecoveryTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedBackupNodeFailureRecoveryTest.java
index 6654fd9..34006bb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedBackupNodeFailureRecoveryTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedBackupNodeFailureRecoveryTest.java
@@ -33,6 +33,7 @@ import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.internal.IgniteEx;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.processors.cache.IgniteCacheAbstractTest;
+import org.apache.ignite.internal.util.typedef.PA;
 
 import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.PRIMARY;
 import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
@@ -40,6 +41,7 @@ import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheRebalanceMode.SYNC;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC;
 import static org.apache.ignite.testframework.GridTestUtils.runAsync;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
 
 /**
  */
@@ -148,11 +150,19 @@ public class IgniteCachePartitionedBackupNodeFailureRecoveryTest extends
IgniteC
 
                         IgniteEx backUp = startGrid(2);
 
-                        IgniteCache<Integer, Integer> cache3 = backUp.cache(null);
+                        final IgniteCache<Integer, Integer> cache3 = backUp.cache(null);
 
                         lock.lock();
 
                         try {
+                            boolean res = waitForCondition(new PA() {
+                                @Override public boolean apply() {
+                                    return cache3.localPeek(finalKey) != null;
+                                }
+                            }, 1000);
+
+                            assertTrue(res);
+
                             Integer backUpVal = cache3.localPeek(finalKey);
 
                             Integer exp = cntr.get();

http://git-wip-us.apache.org/repos/asf/ignite/blob/0e78dd1d/modules/core/src/test/java/org/apache/ignite/internal/processors/odbc/OdbcProcessorValidationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/odbc/OdbcProcessorValidationSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/odbc/OdbcProcessorValidationSelfTest.java
index aaee2a9..2cf0c8f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/odbc/OdbcProcessorValidationSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/odbc/OdbcProcessorValidationSelfTest.java
@@ -21,6 +21,8 @@ import org.apache.ignite.IgniteException;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.OdbcConfiguration;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
@@ -36,7 +38,7 @@ public class OdbcProcessorValidationSelfTest extends GridCommonAbstractTest
{
 
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
-        Ignition.stopAll(true);
+        stopAllGrids();
     }
 
     /**
@@ -159,6 +161,11 @@ public class OdbcProcessorValidationSelfTest extends GridCommonAbstractTest
{
         cfg.setLocalHost("127.0.0.1");
         cfg.setOdbcConfiguration(odbcCfg);
 
+        TcpDiscoverySpi spi = new TcpDiscoverySpi();
+        spi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
+
+        cfg.setDiscoverySpi(spi);
+
         if (success)
             Ignition.start(cfg);
         else {


Mime
View raw message