You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2017/07/07 09:37:07 UTC
[06/50] [abbrv] ignite git commit: Reworked cluster
activation/deactivation.
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java
index d0b2d56..92d1f21 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java
@@ -25,6 +25,7 @@ import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.internal.U;
import static java.lang.Thread.sleep;
import static org.apache.ignite.testframework.GridTestUtils.runAsync;
@@ -54,7 +55,7 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState
}
/**
- *
+ * @throws Exception If failed.
*/
public void testActivateDeActivateOnFixTopology() throws Exception {
final Ignite igB1 = backUp(0);
@@ -140,7 +141,7 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState
}
/**
- *
+ * @throws Exception If failed.
*/
public void testActivateDeActivateOnJoiningNode() throws Exception {
fail("https://issues.apache.org/jira/browse/IGNITE-5520");
@@ -168,9 +169,9 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState
final IgniteInternalFuture<Void> af = runAsync(new Callable<Void>() {
@Override public Void call() throws Exception {
while (!stop.get()) {
- Ignite ig = randomBackUp(false);
-
if (canAct.get()) {
+ Ignite ig = randomBackUp(false);
+
long start = System.currentTimeMillis();
ig.active(true);
@@ -184,6 +185,8 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState
canAct.set(false);
}
+ else
+ U.sleep(100);
}
return null;
@@ -193,9 +196,9 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState
final IgniteInternalFuture<Void> df = runAsync(new Callable<Void>() {
@Override public Void call() throws Exception {
while (!stop.get()) {
- Ignite ig = randomBackUp(false);
-
if (!canAct.get()) {
+ Ignite ig = randomBackUp(false);
+
long start = System.currentTimeMillis();
ig.active(false);
@@ -209,7 +212,8 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState
canAct.set(true);
}
-
+ else
+ U.sleep(100);
}
return null;
}
@@ -243,16 +247,16 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState
jf2.get();
}
finally {
- log.info("total started nodes: " + (seqIdx.get() - backUpNodes()));
+ log.info("Total started nodes: " + (seqIdx.get() - backUpNodes()));
- log.info("total activate/deactivate:" + cntA.get() + "/" + cntD.get() + " aTime/dTime: "
+ log.info("Total activate/deactivate:" + cntA.get() + "/" + cntD.get() + " aTime/dTime: "
+ (timeA.get() / cntA.get() + "/" + (timeD.get() / cntD.get()))
);
}
}
/**
- *
+ * @throws Exception If failed.
*/
public void testActivateDeActivateOnFixTopologyWithPutValues() throws Exception {
final Ignite igB1 = backUp(0);
@@ -348,7 +352,7 @@ public class IgniteChangeGlobalStateFailOverTest extends IgniteChangeGlobalState
df.get();
}
finally {
- log.info("total activate/deactivate:" + cntA.get() + "/" + cntD.get() + " aTime/dTime:"
+ log.info("Total activate/deactivate:" + cntA.get() + "/" + cntD.get() + " aTime/dTime:"
+ (timeA.get() / cntA.get() + "/" + (timeD.get() / cntD.get()) + " nodes: " + backUpNodes()));
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java
index 9151c24..80bf1fb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java
@@ -128,74 +128,65 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
stopAllPrimary();
- final AtomicInteger exCnt = new AtomicInteger();
-
final CyclicBarrier barrier = new CyclicBarrier(backUpNodes() + backUpClientNodes());
IgniteInternalFuture<Void> f1 = runAsync(new Callable<Void>() {
@Override public Void call() throws Exception {
- try {
- barrier.await();
- ig1B.active(true);
- }catch (Exception e){
- exCnt.incrementAndGet();
- }
+ barrier.await();
+
+ ig1B.active(true);
+
return null;
}
});
- IgniteInternalFuture<Void> f2 = runAsync(new Runnable() {
- @Override public void run() {
- try {
- barrier.await();
- ig2B.active(true);
- }catch (Exception e){
- exCnt.incrementAndGet();
- }
+ IgniteInternalFuture<?> f2 = runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ barrier.await();
+
+ ig2B.active(true);
+
+ return null;
}
});
- IgniteInternalFuture<Void> f3 = runAsync(new Runnable() {
- @Override public void run() {
- try {
- barrier.await();
- ig3B.active(true);
- }catch (Exception e){
- exCnt.incrementAndGet();
- }
+ IgniteInternalFuture<?> f3 = runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ barrier.await();
+
+ ig3B.active(true);
+
+ return null;
}
});
- IgniteInternalFuture<Void> f4 = runAsync(new Runnable() {
- @Override public void run() {
- try {
- barrier.await();
- ig1C.active(true);
- }catch (Exception e){
- exCnt.incrementAndGet();
- }
+ IgniteInternalFuture<?> f4 = runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ barrier.await();
+
+ ig1C.active(true);
+
+ return null;
}
});
- IgniteInternalFuture<Void> f5 = runAsync(new Runnable() {
- @Override public void run() {
- try {
- barrier.await();
- ig2C.active(true);
- }catch (Exception e){
- exCnt.incrementAndGet();
- }
+ IgniteInternalFuture<?> f5 = runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ barrier.await();
+
+ ig2C.active(true);
+
+ return null;
}
});
- IgniteInternalFuture<Void> f6 = runAsync(new Runnable() {
- @Override public void run() {
- try {
- barrier.await();
- ig3C.active(true);
- }catch (Exception e){
- exCnt.incrementAndGet();
- }
+ IgniteInternalFuture<?> f6 = runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ barrier.await();
+
+ ig3C.active(true);
+
+ return null;
}
});
@@ -207,8 +198,6 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
f5.get();
f6.get();
- assertTrue(exCnt.get() > 0);
-
assertTrue(ig1B.active());
assertTrue(ig2B.active());
assertTrue(ig3B.active());
@@ -232,40 +221,35 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
stopAllPrimary();
- final AtomicInteger exCnt = new AtomicInteger();
-
final CyclicBarrier barrier = new CyclicBarrier(3);
- IgniteInternalFuture<Void> act1 = runAsync(new Runnable() {
- @Override public void run() {
- try {
- barrier.await();
- ig1B.active(true);
- }catch (Exception e){
- exCnt.incrementAndGet();
- }
+ IgniteInternalFuture<?> act1 = runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ barrier.await();
+
+ ig1B.active(true);
+
+ return null;
}
});
- IgniteInternalFuture<Void> act2 = runAsync(new Runnable() {
- @Override public void run() {
- try {
- barrier.await();
- ig2B.active(true);
- }catch (Exception e){
- exCnt.incrementAndGet();
- }
+ IgniteInternalFuture<?> act2 = runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ barrier.await();
+
+ ig2B.active(true);
+
+ return null;
}
});
- IgniteInternalFuture<Void> act3 = runAsync(new Runnable() {
- @Override public void run() {
- try {
- barrier.await();
- ig3B.active(true);
- }catch (Exception e){
- exCnt.incrementAndGet();
- }
+ IgniteInternalFuture<?> act3 = runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ barrier.await();
+
+ ig3B.active(true);
+
+ return null;
}
});
@@ -273,15 +257,13 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
act2.get();
act3.get();
- assertEquals(2, exCnt.get());
-
assertTrue(ig1B.active());
assertTrue(ig2B.active());
assertTrue(ig3B.active());
}
/**
- *
+ * @throws Exception If failed.
*/
public void testActiveAndInActiveAtTheSameTimeCluster() throws Exception {
Ignite ig1P = primary(0);
@@ -318,7 +300,7 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
}
/**
- *
+ * @throws Exception If failed.
*/
public void testActivateOnAlreadyActivatedCluster() throws Exception {
Ignite ig1P = primary(0);
@@ -375,7 +357,7 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
}
/**
- *
+ * @throws Exception If failed.
*/
public void testTryUseCacheInActiveCluster() throws Exception {
Ignite ig1B = backUp(0);
@@ -410,13 +392,14 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
assertThrows(log, new Callable<Void>() {
@Override public Void call() throws Exception {
IgniteCache cache = ig.cache("cache");
+
return null;
}
}, IgniteException.class, "Can not perform the operation because the cluster is inactive.");
}
/**
- *
+ * @throws Exception If failed.
*/
public void testTryUseServiceInActiveCluster() throws Exception {
Ignite ig1B = backUp(0);
@@ -445,7 +428,7 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
}
/**
- *
+ * @param ig Node to check.
*/
private void checkExceptionTryUseService(final Ignite ig) {
assertThrows(log, new Callable<Void>() {
@@ -458,7 +441,7 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
}
/**
- *
+ * @throws Exception If failed.
*/
public void testTryUseDataStructureInActiveCluster() throws Exception {
Ignite ig1B = backUp(0);
@@ -487,19 +470,20 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
}
/**
- *
+ * @param ig Node.
*/
private void checkExceptionTryUseDataStructure(final Ignite ig){
assertThrows(log, new Callable<Void>() {
@Override public Void call() throws Exception {
IgniteAtomicSequence seq = ig.atomicSequence("seq", 0, true);
+
return null;
}
}, IgniteException.class, "Can not perform the operation because the cluster is inactive.");
}
/**
- *
+ * @throws Exception If failed.
*/
public void testFailGetLock() throws Exception {
Ignite ig1P = primary(0);
@@ -556,7 +540,7 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
}
/**
- *
+ * @throws Exception If failed.
*/
public void testActivateAfterFailGetLock() throws Exception {
Ignite ig1P = primary(0);
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java
index c3bdcda..2678e51 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java
@@ -60,7 +60,7 @@ public class IgniteStandByClusterTest extends GridCommonAbstractTest {
/**
* @throws Exception if fail.
*/
- public void testNotStartDynamicCachesOnClientAfterActivation() throws Exception {
+ public void testStartDynamicCachesAfterActivation() throws Exception {
final String cacheName0 = "cache0";
final String cacheName = "cache";
@@ -114,13 +114,10 @@ public class IgniteStandByClusterTest extends GridCommonAbstractTest {
Map<String, GridCacheAdapter<?, ?>> caches = U.field(ig3.context().cache(), "caches");
// Only system cache and cache0
- assertTrue(caches.size() == 2);
+ assertEquals("Unexpected caches: " + caches.keySet(), 3, caches.size());
assertTrue(caches.containsKey(CU.UTILITY_CACHE_NAME));
assertTrue(caches.containsKey(cacheName0));
-
- assertNull(caches.get(cacheName));
-
- assertNotNull(caches.get(cacheName0));
+ assertTrue(caches.containsKey(cacheName));
assertNotNull(ig3.cache(cacheName));
}
@@ -156,12 +153,6 @@ public class IgniteStandByClusterTest extends GridCommonAbstractTest {
assertTrue(!ig2.active());
assertTrue(!ig3.active());
- for (IgniteEx ig : Arrays.asList(ig1, ig2, ig3)) {
- Map<String, DynamicCacheDescriptor> desc = U.field(U.field(ig.context().cache(), "cachesInfo"), "registeredCaches");
-
- assertEquals(0, desc.size());
- }
-
ig3.active(true);
assertTrue(ig1.active());
@@ -286,7 +277,7 @@ public class IgniteStandByClusterTest extends GridCommonAbstractTest {
private final String name;
/**
- * @param name
+ * @param name Node name.
*/
private NodeFilterIgnoreByName(String name) {
this.name = name;
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/join/JoinActiveNodeToActiveCluster.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/join/JoinActiveNodeToActiveCluster.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/join/JoinActiveNodeToActiveCluster.java
index 9c5f017..8e90e78 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/join/JoinActiveNodeToActiveCluster.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/join/JoinActiveNodeToActiveCluster.java
@@ -29,9 +29,7 @@ import org.junit.Assert;
*
*/
public class JoinActiveNodeToActiveCluster extends AbstractNodeJoinTemplate {
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public JoinNodeTestPlanBuilder withOutConfigurationTemplate() throws Exception {
JoinNodeTestPlanBuilder b = builder();
@@ -56,9 +54,7 @@ public class JoinActiveNodeToActiveCluster extends AbstractNodeJoinTemplate {
return b;
}
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public JoinNodeTestPlanBuilder staticCacheConfigurationOnJoinTemplate() throws Exception {
JoinNodeTestPlanBuilder b = builder();
@@ -85,9 +81,7 @@ public class JoinActiveNodeToActiveCluster extends AbstractNodeJoinTemplate {
return b;
}
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public JoinNodeTestPlanBuilder staticCacheConfigurationInClusterTemplate() throws Exception {
JoinNodeTestPlanBuilder b = builder();
@@ -115,9 +109,7 @@ public class JoinActiveNodeToActiveCluster extends AbstractNodeJoinTemplate {
return b;
}
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public JoinNodeTestPlanBuilder staticCacheConfigurationSameOnBothTemplate() throws Exception {
JoinNodeTestPlanBuilder b = builder();
@@ -146,9 +138,7 @@ public class JoinActiveNodeToActiveCluster extends AbstractNodeJoinTemplate {
return b;
}
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public JoinNodeTestPlanBuilder staticCacheConfigurationDifferentOnBothTemplate() throws Exception {
JoinNodeTestPlanBuilder b = builder();
@@ -207,62 +197,46 @@ public class JoinActiveNodeToActiveCluster extends AbstractNodeJoinTemplate {
withOutConfigurationTemplate().execute();
}
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public void testStaticCacheConfigurationOnJoin() throws Exception {
staticCacheConfigurationOnJoinTemplate().execute();
}
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public void testStaticCacheConfigurationInCluster() throws Exception {
staticCacheConfigurationInClusterTemplate().execute();
}
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public void testStaticCacheConfigurationSameOnBoth() throws Exception {
staticCacheConfigurationSameOnBothTemplate().execute();
}
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public void testStaticCacheConfigurationDifferentOnBoth() throws Exception {
staticCacheConfigurationDifferentOnBothTemplate().execute();
}
// Client node join.
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public void testJoinClientWithOutConfiguration() throws Exception {
joinClientWithOutConfigurationTemplate().execute();
}
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public void testJoinClientStaticCacheConfigurationOnJoin() throws Exception {
joinClientStaticCacheConfigurationOnJoinTemplate().execute();
}
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public void testJoinClientStaticCacheConfigurationInCluster() throws Exception {
fail("https://issues.apache.org/jira/browse/IGNITE-5518");
joinClientStaticCacheConfigurationInClusterTemplate().execute();
}
- /**
- *
- */
+ /** {@inheritDoc} */
@Override public void testJoinClientStaticCacheConfigurationSameOnBoth() throws Exception {
joinClientStaticCacheConfigurationSameOnBothTemplate().execute();
}
@@ -276,14 +250,17 @@ public class JoinActiveNodeToActiveCluster extends AbstractNodeJoinTemplate {
joinClientStaticCacheConfigurationDifferentOnBothTemplate().execute();
}
+ /** {@inheritDoc} */
@Override public JoinNodeTestPlanBuilder joinClientWithOutConfigurationTemplate() throws Exception {
return withOutConfigurationTemplate().nodeConfiguration(setClient);
}
+ /** {@inheritDoc} */
@Override public JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationOnJoinTemplate() throws Exception {
return staticCacheConfigurationOnJoinTemplate().nodeConfiguration(setClient);
}
+ /** {@inheritDoc} */
@Override public JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationInClusterTemplate() throws Exception {
return staticCacheConfigurationInClusterTemplate()
.nodeConfiguration(setClient)
@@ -360,8 +337,10 @@ public class JoinActiveNodeToActiveCluster extends AbstractNodeJoinTemplate {
});
}
- @Override
- public JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationDifferentOnBothTemplate() throws Exception {
+ /** {@inheritDoc} */
+ @Override public JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationDifferentOnBothTemplate()
+ throws Exception
+ {
return staticCacheConfigurationDifferentOnBothTemplate()
.nodeConfiguration(setClient)
.afterActivate(new Runnable() {
@@ -436,6 +415,7 @@ public class JoinActiveNodeToActiveCluster extends AbstractNodeJoinTemplate {
});
}
+ /** {@inheritDoc} */
@Override public JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationSameOnBothTemplate() throws Exception {
return staticCacheConfigurationSameOnBothTemplate().nodeConfiguration(setClient);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/join/persistence/JoinActiveNodeToActiveClusterWithPersistence.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/join/persistence/JoinActiveNodeToActiveClusterWithPersistence.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/join/persistence/JoinActiveNodeToActiveClusterWithPersistence.java
index 60388fa..1ccfb7d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/join/persistence/JoinActiveNodeToActiveClusterWithPersistence.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/join/persistence/JoinActiveNodeToActiveClusterWithPersistence.java
@@ -30,6 +30,10 @@ public class JoinActiveNodeToActiveClusterWithPersistence extends JoinActiveNode
return persistentCfg(super.cfg(name));
}
+ /**
+ * @param b Builder.
+ * @return Builder.
+ */
private AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder persistent(AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder b) {
b.afterClusterStarted(
b.checkCacheEmpty()
@@ -44,6 +48,7 @@ public class JoinActiveNodeToActiveClusterWithPersistence extends JoinActiveNode
return b;
}
+ /** {@inheritDoc} */
@Override public AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder withOutConfigurationTemplate() throws Exception {
AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder b = persistent(super.withOutConfigurationTemplate());
@@ -52,6 +57,7 @@ public class JoinActiveNodeToActiveClusterWithPersistence extends JoinActiveNode
return b;
}
+ /** {@inheritDoc} */
@Override public AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder joinClientWithOutConfigurationTemplate() throws Exception {
AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder b = persistent(super.joinClientWithOutConfigurationTemplate());
@@ -60,46 +66,57 @@ public class JoinActiveNodeToActiveClusterWithPersistence extends JoinActiveNode
return b;
}
+ /** {@inheritDoc} */
@Override public void testJoinWithOutConfiguration() throws Exception {
withOutConfigurationTemplate().execute();
}
+ /** {@inheritDoc} */
@Override public void testJoinClientWithOutConfiguration() throws Exception {
joinClientWithOutConfigurationTemplate().execute();
}
+ /** {@inheritDoc} */
@Override public void testJoinClientStaticCacheConfigurationDifferentOnBoth() throws Exception {
staticCacheConfigurationDifferentOnBothTemplate().execute();
}
+ /** {@inheritDoc} */
@Override public void testJoinClientStaticCacheConfigurationInCluster() throws Exception {
staticCacheConfigurationInClusterTemplate().execute();
}
+ /** {@inheritDoc} */
@Override public AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder staticCacheConfigurationOnJoinTemplate() throws Exception {
return persistent(super.staticCacheConfigurationOnJoinTemplate());
}
+ /** {@inheritDoc} */
@Override public AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder staticCacheConfigurationInClusterTemplate() throws Exception {
return persistent(super.staticCacheConfigurationInClusterTemplate());
}
+ /** {@inheritDoc} */
@Override public AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder staticCacheConfigurationSameOnBothTemplate() throws Exception {
return persistent(super.staticCacheConfigurationSameOnBothTemplate());
}
+ /** {@inheritDoc} */
@Override public AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder staticCacheConfigurationDifferentOnBothTemplate() throws Exception {
return persistent(super.staticCacheConfigurationDifferentOnBothTemplate());
}
+ /** {@inheritDoc} */
@Override public AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationOnJoinTemplate() throws Exception {
return persistent(super.joinClientStaticCacheConfigurationOnJoinTemplate());
}
+ /** {@inheritDoc} */
@Override public AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationInClusterTemplate() throws Exception {
return persistent(super.joinClientStaticCacheConfigurationInClusterTemplate());
}
+ /** {@inheritDoc} */
@Override public AbstractNodeJoinTemplate.JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationDifferentOnBothTemplate() throws Exception {
return persistent(super.joinClientStaticCacheConfigurationDifferentOnBothTemplate());
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectTest.java
index 02f7d00..548dba2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectTest.java
@@ -24,7 +24,9 @@ import org.apache.ignite.internal.IgniteEx;
*
*/
public class IgniteStandByClientReconnectTest extends IgniteAbstractStandByClientReconnectTest {
-
+ /**
+ * @throws Exception If failed.
+ */
public void testActiveClientReconnectToActiveCluster() throws Exception {
CountDownLatch activateLatch = new CountDownLatch(1);
@@ -103,6 +105,9 @@ public class IgniteStandByClientReconnectTest extends IgniteAbstractStandByClien
checkAllCaches();
}
+ /**
+ * @throws Exception If failed.
+ */
public void testActiveClientReconnectToInActiveCluster() throws Exception {
CountDownLatch activateLatch = new CountDownLatch(1);
@@ -180,6 +185,9 @@ public class IgniteStandByClientReconnectTest extends IgniteAbstractStandByClien
checkAllCaches();
}
+ /**
+ * @throws Exception If failed.
+ */
public void testInActiveClientReconnectToActiveCluster() throws Exception {
CountDownLatch activateLatch = new CountDownLatch(1);
@@ -234,6 +242,9 @@ public class IgniteStandByClientReconnectTest extends IgniteAbstractStandByClien
checkAllCaches();
}
+ /**
+ * @throws Exception If failed.
+ */
public void testInActiveClientReconnectToInActiveCluster() throws Exception {
startNodes(null);
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java
index 2bcc177..2da32e3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java
@@ -27,7 +27,9 @@ import org.apache.ignite.internal.IgniteEx;
*
*/
public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstractStandByClientReconnectTest {
-
+ /**
+ * @throws Exception If failed.
+ */
public void testActiveClientReconnectToActiveCluster() throws Exception {
CountDownLatch activateLatch = new CountDownLatch(1);
@@ -104,6 +106,9 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
checkAllCaches();
}
+ /**
+ * @throws Exception If failed.
+ */
public void testActiveClientReconnectToInActiveCluster() throws Exception {
startNodes(null);
@@ -181,6 +186,9 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
checkAllCaches();
}
+ /**
+ * @throws Exception If failed.
+ */
public void testInActiveClientReconnectToActiveCluster() throws Exception {
CountDownLatch activateLatch = new CountDownLatch(1);
@@ -236,6 +244,9 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
checkDescriptors(client, exp2);
}
+ /**
+ * @throws Exception If failed.
+ */
public void testInActiveClientReconnectToInActiveCluster() throws Exception {
startNodes(null);
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
index 90af25e..bc07028 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
@@ -479,7 +479,7 @@ public class GridTcpCommunicationSpiMultithreadedSelfTest extends GridSpiAbstrac
timeoutProcessor.start();
- timeoutProcessor.onKernalStart();
+ timeoutProcessor.onKernalStart(true);
for (int i = 0; i < getSpiCount(); i++) {
CommunicationSpi<Message> spi = newCommunicationSpi();
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index a9a870e..d6d241c 100755
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -2099,13 +2099,13 @@ public abstract class GridAbstractTest extends TestCase {
for (Ignite g : G.allGrids()) {
final GridKernalContext ctx = ((IgniteKernal)g).context();
- if (ctx.isStopping())
+ if (ctx.isStopping() || !g.active())
continue;
AffinityTopologyVersion topVer = ctx.discovery().topologyVersionEx();
AffinityTopologyVersion exchVer = ctx.cache().context().exchange().readyAffinityVersion();
- if (! topVer.equals(exchVer)) {
+ if (!topVer.equals(exchVer)) {
info("Topology version mismatch [node=" + g.name() +
", exchVer=" + exchVer +
", topVer=" + topVer + ']');
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index 3f87c76..dc7e89d 100755
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -596,6 +596,9 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
else
startTime = g0.context().discovery().gridStartTime();
+ if (g.cluster().localNode().isDaemon())
+ continue;
+
IgniteInternalFuture<?> exchFut =
g0.context().cache().context().exchange().affinityReadyFuture(waitTopVer);
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStandByClusterSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStandByClusterSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStandByClusterSuite.java
index 6fa158d..f016e39 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStandByClusterSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStandByClusterSuite.java
@@ -18,6 +18,7 @@
package org.apache.ignite.testsuites;
import junit.framework.TestSuite;
+import org.apache.ignite.internal.processors.cache.IgniteClusterActivateDeactivateTest;
import org.apache.ignite.internal.processors.cache.persistence.standbycluster.IgniteChangeGlobalStateCacheTest;
import org.apache.ignite.internal.processors.cache.persistence.standbycluster.IgniteChangeGlobalStateDataStreamerTest;
import org.apache.ignite.internal.processors.cache.persistence.standbycluster.IgniteChangeGlobalStateDataStructureTest;
@@ -41,11 +42,13 @@ import org.apache.ignite.internal.processors.cache.persistence.standbycluster.re
*/
public class IgniteStandByClusterSuite extends TestSuite {
/**
- *
+ * @return Test suite.
*/
public static TestSuite suite() {
TestSuite suite = new TestSuite("Ignite Activate/DeActivate Cluster Test Suit");
+ suite.addTestSuite(IgniteClusterActivateDeactivateTest.class);
+
suite.addTestSuite(IgniteStandByClusterTest.class);
suite.addTestSuite(IgniteStandByClientReconnectTest.class);
suite.addTestSuite(IgniteStandByClientReconnectToNewClusterTest.class);
http://git-wip-us.apache.org/repos/asf/ignite/blob/1337901f/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopProcessor.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopProcessor.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopProcessor.java
index 329d67f..231fc22 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopProcessor.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopProcessor.java
@@ -95,8 +95,8 @@ public class HadoopProcessor extends HadoopProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public void onKernalStart() throws IgniteCheckedException {
- super.onKernalStart();
+ @Override public void onKernalStart(boolean active) throws IgniteCheckedException {
+ super.onKernalStart(active);
if (hctx == null)
return;