use of org.apache.ignite.internal.util.nodestart.IgniteNodeStartUtils.KEY in project ignite by apache.
the class IgniteProjectionStartStopRestartSelfTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() {
if (SSH_KEY != null) {
key = new File(SSH_KEY);
assert key.exists() : "Private key doesn't exist: " + key.getAbsolutePath();
assert key.isFile() : "Private key is not a file: " + key.getAbsolutePath();
} else
pwd = SSH_PWD;
log.info("Username: " + SSH_UNAME);
log.info("Password: " + pwd);
log.info("Key path: " + key);
G.setDaemon(true);
ignite = G.start(CFG_NO_ATTR);
G.setDaemon(false);
ignite.events().localListen((IgnitePredicate<Event>) evt -> {
info("Received event: " + evt.shortDisplay());
if (evt.type() == EVT_NODE_JOINED) {
joinedCnt.incrementAndGet();
if (joinedLatch != null)
joinedLatch.countDown();
} else if (evt.type() == EVT_NODE_LEFT || evt.type() == EVT_NODE_FAILED) {
leftCnt.incrementAndGet();
if (leftLatch != null)
leftLatch.countDown();
}
return true;
}, EVT_NODE_JOINED, EVT_NODE_LEFT, EVT_NODE_FAILED);
}
Aggregations