use of com.bakdata.conquery.models.messages.network.specific.AddShardNode in project conquery by bakdata.
the class ShardNode method sessionOpened.
@Override
public void sessionOpened(IoSession session) throws Exception {
setLocation(session);
NetworkSession networkSession = new NetworkSession(session);
context = new NetworkMessageContext.ShardNodeNetworkContext(jobManager, networkSession, workers, config, validator);
log.info("Connected to ManagerNode @ {}", session.getRemoteAddress());
// Authenticate with ManagerNode
context.send(new AddShardNode());
for (Worker w : workers.getWorkers().values()) {
w.setSession(new NetworkSession(session));
WorkerInformation info = w.getInfo();
log.info("Sending worker identity '{}'", info.getName());
networkSession.send(new RegisterWorker(info));
}
}
Aggregations