Repository: incubator-ignite Updated Branches: refs/heads/ignite-tc-snodes [created] 69c496bf5
start nodes tc: add logging + comment tests Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/69c496bf Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/69c496bf Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/69c496bf Branch: refs/heads/ignite-tc-snodes Commit: 69c496bf573995b7ac917094a13cd4baa8e3e9ba Parents: 9b23109 Author: Artem Shutak <ashu...@gridgain.com> Authored: Thu Apr 2 17:24:19 2015 +0300 Committer: Artem Shutak <ashu...@gridgain.com> Committed: Thu Apr 2 17:24:19 2015 +0300 ---------------------------------------------------------------------- .../eventstorage/GridEventStorageManager.java | 2 + ...gniteProjectionStartStopRestartSelfTest.java | 1444 +++++++++--------- 2 files changed, 723 insertions(+), 723 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/69c496bf/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java index e8c9396..dd91d52 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java @@ -247,6 +247,8 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi> */ public void record(Event evt) { assert evt != null; + + log.info(">>>>> Record event=" + evt); if (!enterBusy()) return; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/69c496bf/modules/ssh/src/test/java/org/apache/ignite/internal/IgniteProjectionStartStopRestartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/ssh/src/test/java/org/apache/ignite/internal/IgniteProjectionStartStopRestartSelfTest.java b/modules/ssh/src/test/java/org/apache/ignite/internal/IgniteProjectionStartStopRestartSelfTest.java index d4c5fc5..ae9ae81 100644 --- a/modules/ssh/src/test/java/org/apache/ignite/internal/IgniteProjectionStartStopRestartSelfTest.java +++ b/modules/ssh/src/test/java/org/apache/ignite/internal/IgniteProjectionStartStopRestartSelfTest.java @@ -18,7 +18,6 @@ package org.apache.ignite.internal; import org.apache.ignite.*; -import org.apache.ignite.cluster.*; import org.apache.ignite.events.*; import org.apache.ignite.internal.util.lang.*; import org.apache.ignite.internal.util.nodestart.*; @@ -29,7 +28,6 @@ import org.apache.ignite.testframework.junits.common.*; import org.jetbrains.annotations.*; import java.io.*; -import java.nio.file.*; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; @@ -113,9 +111,9 @@ public class IgniteProjectionStartStopRestartSelfTest extends GridCommonAbstract else pwd = SSH_PWD; - log.info("Username: " + SSH_UNAME); - log.info("Password: " + pwd); - log.info("Key path: " + key); + log.info("Username: '" + SSH_UNAME + '\''); + log.info("Password: '" + pwd + '\''); + log.info("Key path: '" + key + '\''); G.setDaemon(true); @@ -202,724 +200,724 @@ public class IgniteProjectionStartStopRestartSelfTest extends GridCommonAbstract assert ignite.cluster().nodes().size() == 1; } - /** - * @throws Exception If failed. - */ - public void testStartThreeNodes() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, DFLT_TIMEOUT, 1); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert joinedCnt.get() == 3; - assert leftCnt.get() == 0; - - assert ignite.cluster().nodes().size() == 3; - } - - /** - * @throws Exception If failed. - */ - public void testStartThreeNodesAndDoEmptyCall() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert joinedCnt.get() == 3; - assert leftCnt.get() == 0; - - assert ignite.cluster().nodes().size() == 3; - - res = startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.isEmpty(); - - assert joinedCnt.get() == 3; - assert leftCnt.get() == 0; - - assert ignite.cluster().nodes().size() == 3; - } - - /** - * @throws Exception If failed. - */ - public void testStartThreeNodesAndTryToStartOneNode() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert joinedCnt.get() == 3; - assert leftCnt.get() == 0; - - assert ignite.cluster().nodes().size() == 3; - - res = startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 1, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.isEmpty(); - - assert joinedCnt.get() == 3; - assert leftCnt.get() == 0; - - assert ignite.cluster().nodes().size() == 3; - } - - /** - * @throws Exception If failed. - */ - public void testStartFiveNodesInTwoCalls() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert joinedCnt.get() == 3; - assert leftCnt.get() == 0; - - assert ignite.cluster().nodes().size() == 3; - - joinedLatch = new CountDownLatch(2); - - res = startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 5, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 2; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert joinedCnt.get() == 5; - assert leftCnt.get() == 0; - - assert ignite.cluster().nodes().size() == 5; - } - - /** - * @throws Exception If failed. - */ - public void testStartFiveWithTwoSpecs() throws Exception { - joinedLatch = new CountDownLatch(5); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - F.asList(map(HOST, SSH_UNAME, pwd, key, 2, U.getIgniteHome(), CFG_NO_ATTR, null), - map(HOST, SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null)), - null, false, 0, 16); - - assert res.size() == 5; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert joinedCnt.get() == 5; - assert leftCnt.get() == 0; - - assert ignite.cluster().nodes().size() == 5; - } - - /** - * @throws Exception If failed. - */ - public void testStartThreeNodesAndRestart() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert joinedCnt.get() == 3; - assert leftCnt.get() == 0; - - assert ignite.cluster().nodes().size() == 3; - - joinedLatch = new CountDownLatch(3); - leftLatch = new CountDownLatch(3); - - res = startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, true, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert joinedCnt.get() == 6; - assert leftCnt.get() == 3; - - assert ignite.cluster().nodes().size() == 3; - } - - /** - * @throws Exception If failed. - */ - public void testCustomScript() throws Exception { - joinedLatch = new CountDownLatch(1); - - String script = U.isWindows() ? CUSTOM_SCRIPT_WIN : CUSTOM_SCRIPT_LINUX; - - script = Paths.get(U.getIgniteHome()).relativize(U.resolveIgnitePath(script).toPath()).toString(); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 1, U.getIgniteHome(), null, script), - null, false, 0, 16); - - assert res.size() == 1; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert joinedCnt.get() == 1; - assert leftCnt.get() == 0; - - assert ignite.cluster().nodes().size() == 1; - - assert CUSTOM_CFG_ATTR_VAL.equals(F.first(ignite.cluster().nodes()).<String>attribute(CUSTOM_CFG_ATTR_KEY)); - } - - /** - * @throws Exception If failed. - */ - public void testStopNodes() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, null, 3, U.getIgniteHome(), CFG_NO_ATTR, - null), null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - - leftLatch = new CountDownLatch(3); - - ignite.cluster().stopNodes(); - - assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().isEmpty(); - } - - /** - * @throws Exception If failed. - */ - public void testStopNodesFiltered() throws Exception { - joinedLatch = new CountDownLatch(2); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 2, U.getIgniteHome(), CFG_ATTR, null), - null, false, 0, 16); - - assert res.size() == 2; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - joinedLatch = new CountDownLatch(1); - - res = startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 1; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - - leftLatch = new CountDownLatch(2); - - Collection<UUID> ids = F.transform(ignite.cluster().forAttribute(CUSTOM_CFG_ATTR_KEY, CUSTOM_CFG_ATTR_VAL).nodes(), - new IgniteClosure<ClusterNode, UUID>() { - @Override public UUID apply(ClusterNode node) { - return node.id(); - } - }); - - ignite.cluster().forAttribute(CUSTOM_CFG_ATTR_KEY, CUSTOM_CFG_ATTR_VAL).nodes(); - - ignite.cluster().stopNodes(ids); - - assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 1; - } - - /** - * @throws Exception If failed. - */ - public void testStopNodeById() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - - leftLatch = new CountDownLatch(1); - - ignite.cluster().stopNodes(Collections.singleton(F.first(ignite.cluster().forRemotes().nodes()).id())); - - assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 2; - } - - /** - * @throws Exception If failed. - */ - public void testStopNodesByIds() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - - leftLatch = new CountDownLatch(2); - - Iterator<ClusterNode> it = ignite.cluster().nodes().iterator(); - - Collection<UUID> ids = new HashSet<>(); - - ids.add(it.next().id()); - ids.add(it.next().id()); - - ignite.cluster().stopNodes(ids); - - assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 1; - } - - /** - * @throws Exception If failed. - */ - public void testStopNodesByIdsC() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - - leftLatch = new CountDownLatch(2); - - Iterator<ClusterNode> it = ignite.cluster().nodes().iterator(); - - ignite.cluster().stopNodes(F.asList(it.next().id(), it.next().id())); - - assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 1; - } - - /** - * @throws Exception If failed. - */ - public void testRestartNodes() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - - joinedLatch = new CountDownLatch(3); - leftLatch = new CountDownLatch(3); - - ignite.cluster().restartNodes(); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - } - - /** - * @throws Exception If failed. - */ - public void testRestartNodesFiltered() throws Exception { - joinedLatch = new CountDownLatch(2); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 2, U.getIgniteHome(), CFG_ATTR, null), - null, false, 0, 16); - - assert res.size() == 2; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - joinedLatch = new CountDownLatch(1); - - res = startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 1; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - - joinedLatch = new CountDownLatch(2); - leftLatch = new CountDownLatch(2); - - X.println("Restarting nodes with " + CUSTOM_CFG_ATTR_KEY); - - Collection<UUID> ids = F.transform(ignite.cluster().forAttribute(CUSTOM_CFG_ATTR_KEY, CUSTOM_CFG_ATTR_VAL).nodes(), - new IgniteClosure<ClusterNode, UUID>() { - @Override public UUID apply(ClusterNode node) { - return node.id(); - } - } - ); - - ignite.cluster().restartNodes(ids); - - assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - } - - /** - * @throws Exception If failed. - */ - public void testRestartNodeById() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - - joinedLatch = new CountDownLatch(1); - leftLatch = new CountDownLatch(1); - - ignite.cluster().restartNodes(Collections.singleton(F.first(ignite.cluster().forRemotes().nodes()).id())); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - } - - /** - * @throws Exception If failed. - */ - public void testRestartNodesByIds() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - - joinedLatch = new CountDownLatch(2); - leftLatch = new CountDownLatch(2); - - Iterator<ClusterNode> it = ignite.cluster().nodes().iterator(); - - ignite.cluster().restartNodes(F.asList(it.next().id(), it.next().id())); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - } - - /** - * @throws Exception If failed. - */ - public void testRestartNodesByIdsC() throws Exception { - joinedLatch = new CountDownLatch(3); - - Collection<GridTuple3<String, Boolean, String>> res = - startNodes(ignite.cluster(), - maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), - null, false, 0, 16); - - assert res.size() == 3; - - F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { - @Override public void apply(GridTuple3<String, Boolean, String> t) { - assert t.get1().equals(HOST); - - if (!t.get2()) - throw new IgniteException(t.get3()); - } - }); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - - joinedLatch = new CountDownLatch(2); - leftLatch = new CountDownLatch(2); - - Iterator<ClusterNode> it = ignite.cluster().nodes().iterator(); - - ignite.cluster().restartNodes(F.asList(it.next().id(), it.next().id())); - - assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); - assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); - - assert ignite.cluster().nodes().size() == 3; - } +// /** +// * @throws Exception If failed. +// */ +// public void testStartThreeNodes() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, DFLT_TIMEOUT, 1); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert joinedCnt.get() == 3; +// assert leftCnt.get() == 0; +// +// assert ignite.cluster().nodes().size() == 3; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testStartThreeNodesAndDoEmptyCall() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert joinedCnt.get() == 3; +// assert leftCnt.get() == 0; +// +// assert ignite.cluster().nodes().size() == 3; +// +// res = startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.isEmpty(); +// +// assert joinedCnt.get() == 3; +// assert leftCnt.get() == 0; +// +// assert ignite.cluster().nodes().size() == 3; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testStartThreeNodesAndTryToStartOneNode() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert joinedCnt.get() == 3; +// assert leftCnt.get() == 0; +// +// assert ignite.cluster().nodes().size() == 3; +// +// res = startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 1, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.isEmpty(); +// +// assert joinedCnt.get() == 3; +// assert leftCnt.get() == 0; +// +// assert ignite.cluster().nodes().size() == 3; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testStartFiveNodesInTwoCalls() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert joinedCnt.get() == 3; +// assert leftCnt.get() == 0; +// +// assert ignite.cluster().nodes().size() == 3; +// +// joinedLatch = new CountDownLatch(2); +// +// res = startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 5, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 2; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert joinedCnt.get() == 5; +// assert leftCnt.get() == 0; +// +// assert ignite.cluster().nodes().size() == 5; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testStartFiveWithTwoSpecs() throws Exception { +// joinedLatch = new CountDownLatch(5); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// F.asList(map(HOST, SSH_UNAME, pwd, key, 2, U.getIgniteHome(), CFG_NO_ATTR, null), +// map(HOST, SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null)), +// null, false, 0, 16); +// +// assert res.size() == 5; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert joinedCnt.get() == 5; +// assert leftCnt.get() == 0; +// +// assert ignite.cluster().nodes().size() == 5; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testStartThreeNodesAndRestart() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert joinedCnt.get() == 3; +// assert leftCnt.get() == 0; +// +// assert ignite.cluster().nodes().size() == 3; +// +// joinedLatch = new CountDownLatch(3); +// leftLatch = new CountDownLatch(3); +// +// res = startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, true, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert joinedCnt.get() == 6; +// assert leftCnt.get() == 3; +// +// assert ignite.cluster().nodes().size() == 3; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testCustomScript() throws Exception { +// joinedLatch = new CountDownLatch(1); +// +// String script = U.isWindows() ? CUSTOM_SCRIPT_WIN : CUSTOM_SCRIPT_LINUX; +// +// script = Paths.get(U.getIgniteHome()).relativize(U.resolveIgnitePath(script).toPath()).toString(); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 1, U.getIgniteHome(), null, script), +// null, false, 0, 16); +// +// assert res.size() == 1; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert joinedCnt.get() == 1; +// assert leftCnt.get() == 0; +// +// assert ignite.cluster().nodes().size() == 1; +// +// assert CUSTOM_CFG_ATTR_VAL.equals(F.first(ignite.cluster().nodes()).<String>attribute(CUSTOM_CFG_ATTR_KEY)); +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testStopNodes() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, null, 3, U.getIgniteHome(), CFG_NO_ATTR, +// null), null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// +// leftLatch = new CountDownLatch(3); +// +// ignite.cluster().stopNodes(); +// +// assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().isEmpty(); +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testStopNodesFiltered() throws Exception { +// joinedLatch = new CountDownLatch(2); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 2, U.getIgniteHome(), CFG_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 2; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// joinedLatch = new CountDownLatch(1); +// +// res = startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 1; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// +// leftLatch = new CountDownLatch(2); +// +// Collection<UUID> ids = F.transform(ignite.cluster().forAttribute(CUSTOM_CFG_ATTR_KEY, CUSTOM_CFG_ATTR_VAL).nodes(), +// new IgniteClosure<ClusterNode, UUID>() { +// @Override public UUID apply(ClusterNode node) { +// return node.id(); +// } +// }); +// +// ignite.cluster().forAttribute(CUSTOM_CFG_ATTR_KEY, CUSTOM_CFG_ATTR_VAL).nodes(); +// +// ignite.cluster().stopNodes(ids); +// +// assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 1; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testStopNodeById() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// +// leftLatch = new CountDownLatch(1); +// +// ignite.cluster().stopNodes(Collections.singleton(F.first(ignite.cluster().forRemotes().nodes()).id())); +// +// assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 2; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testStopNodesByIds() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// +// leftLatch = new CountDownLatch(2); +// +// Iterator<ClusterNode> it = ignite.cluster().nodes().iterator(); +// +// Collection<UUID> ids = new HashSet<>(); +// +// ids.add(it.next().id()); +// ids.add(it.next().id()); +// +// ignite.cluster().stopNodes(ids); +// +// assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 1; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testStopNodesByIdsC() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// +// leftLatch = new CountDownLatch(2); +// +// Iterator<ClusterNode> it = ignite.cluster().nodes().iterator(); +// +// ignite.cluster().stopNodes(F.asList(it.next().id(), it.next().id())); +// +// assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 1; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testRestartNodes() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// +// joinedLatch = new CountDownLatch(3); +// leftLatch = new CountDownLatch(3); +// +// ignite.cluster().restartNodes(); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testRestartNodesFiltered() throws Exception { +// joinedLatch = new CountDownLatch(2); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 2, U.getIgniteHome(), CFG_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 2; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// joinedLatch = new CountDownLatch(1); +// +// res = startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 1; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// +// joinedLatch = new CountDownLatch(2); +// leftLatch = new CountDownLatch(2); +// +// X.println("Restarting nodes with " + CUSTOM_CFG_ATTR_KEY); +// +// Collection<UUID> ids = F.transform(ignite.cluster().forAttribute(CUSTOM_CFG_ATTR_KEY, CUSTOM_CFG_ATTR_VAL).nodes(), +// new IgniteClosure<ClusterNode, UUID>() { +// @Override public UUID apply(ClusterNode node) { +// return node.id(); +// } +// } +// ); +// +// ignite.cluster().restartNodes(ids); +// +// assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testRestartNodeById() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// +// joinedLatch = new CountDownLatch(1); +// leftLatch = new CountDownLatch(1); +// +// ignite.cluster().restartNodes(Collections.singleton(F.first(ignite.cluster().forRemotes().nodes()).id())); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testRestartNodesByIds() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// +// joinedLatch = new CountDownLatch(2); +// leftLatch = new CountDownLatch(2); +// +// Iterator<ClusterNode> it = ignite.cluster().nodes().iterator(); +// +// ignite.cluster().restartNodes(F.asList(it.next().id(), it.next().id())); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// } +// +// /** +// * @throws Exception If failed. +// */ +// public void testRestartNodesByIdsC() throws Exception { +// joinedLatch = new CountDownLatch(3); +// +// Collection<GridTuple3<String, Boolean, String>> res = +// startNodes(ignite.cluster(), +// maps(Collections.singleton(HOST), SSH_UNAME, pwd, key, 3, U.getIgniteHome(), CFG_NO_ATTR, null), +// null, false, 0, 16); +// +// assert res.size() == 3; +// +// F.forEach(res, new CI1<GridTuple3<String, Boolean, String>>() { +// @Override public void apply(GridTuple3<String, Boolean, String> t) { +// assert t.get1().equals(HOST); +// +// if (!t.get2()) +// throw new IgniteException(t.get3()); +// } +// }); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// +// joinedLatch = new CountDownLatch(2); +// leftLatch = new CountDownLatch(2); +// +// Iterator<ClusterNode> it = ignite.cluster().nodes().iterator(); +// +// ignite.cluster().restartNodes(F.asList(it.next().id(), it.next().id())); +// +// assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// assert leftLatch.await(WAIT_TIMEOUT, MILLISECONDS); +// +// assert ignite.cluster().nodes().size() == 3; +// } /** * @param host Hostname.