use of org.apache.ignite.IgniteException in project ignite by apache.
the class IgniteProjectionStartStopRestartSelfTest method testStartThreeNodes.
/**
* @throws Exception If failed.
*/
public void testStartThreeNodes() throws Exception {
joinedLatch = new CountDownLatch(3);
Collection<ClusterStartNodeResult> 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<ClusterStartNodeResult>() {
@Override
public void apply(ClusterStartNodeResult t) {
assert t.getHostName().equals(HOST);
if (!t.isSuccess())
throw new IgniteException(t.getError());
}
});
assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS);
assert joinedCnt.get() == 3;
assert leftCnt.get() == 0;
assert ignite.cluster().nodes().size() == 3;
}
use of org.apache.ignite.IgniteException in project ignite by apache.
the class IgniteProjectionStartStopRestartSelfTest method testStopNodeById.
/**
* @throws Exception If failed.
*/
public void testStopNodeById() throws Exception {
joinedLatch = new CountDownLatch(3);
Collection<ClusterStartNodeResult> 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<ClusterStartNodeResult>() {
@Override
public void apply(ClusterStartNodeResult t) {
assert t.getHostName().equals(HOST);
if (!t.isSuccess())
throw new IgniteException(t.getError());
}
});
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;
}
use of org.apache.ignite.IgniteException in project ignite by apache.
the class IgniteProjectionStartStopRestartSelfTest method testStopNodesByIds.
/**
* @throws Exception If failed.
*/
public void testStopNodesByIds() throws Exception {
joinedLatch = new CountDownLatch(3);
Collection<ClusterStartNodeResult> 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<ClusterStartNodeResult>() {
@Override
public void apply(ClusterStartNodeResult t) {
assert t.getHostName().equals(HOST);
if (!t.isSuccess())
throw new IgniteException(t.getError());
}
});
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;
}
use of org.apache.ignite.IgniteException in project ignite by apache.
the class IgniteProjectionStartStopRestartSelfTest method testStartOneNode.
/**
* @throws Exception If failed.
*/
public void testStartOneNode() throws Exception {
joinedLatch = new CountDownLatch(1);
Collection<ClusterStartNodeResult> 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.size() == 1;
F.forEach(res, new CI1<ClusterStartNodeResult>() {
@Override
public void apply(ClusterStartNodeResult t) {
assert t.getHostName().equals(HOST);
if (!t.isSuccess())
throw new IgniteException(t.getError());
}
});
assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS);
assert joinedCnt.get() == 1;
assert leftCnt.get() == 0;
assert ignite.cluster().nodes().size() == 1;
}
use of org.apache.ignite.IgniteException in project ignite by apache.
the class IgniteProjectionStartStopRestartSelfTest method testStartFiveWithTwoSpecs.
/**
* @throws Exception If failed.
*/
public void testStartFiveWithTwoSpecs() throws Exception {
joinedLatch = new CountDownLatch(5);
Collection<ClusterStartNodeResult> 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<ClusterStartNodeResult>() {
@Override
public void apply(ClusterStartNodeResult t) {
assert t.getHostName().equals(HOST);
if (!t.isSuccess())
throw new IgniteException(t.getError());
}
});
assert joinedLatch.await(WAIT_TIMEOUT, MILLISECONDS);
assert joinedCnt.get() == 5;
assert leftCnt.get() == 0;
assert ignite.cluster().nodes().size() == 5;
}
Aggregations