use of com.bakdata.conquery.models.messages.network.MessageToShardNode in project conquery by bakdata.
the class ShardNode method messageReceived.
@Override
public void messageReceived(IoSession session, Object message) throws Exception {
setLocation(session);
if (!(message instanceof MessageToShardNode)) {
log.error("Unknown message type {} in {}", message.getClass(), message);
return;
}
MessageToShardNode srm = (MessageToShardNode) message;
log.trace("{} recieved {} from {}", getName(), message.getClass().getSimpleName(), session.getRemoteAddress());
ReactingJob<MessageToShardNode, ShardNodeNetworkContext> job = new ReactingJob<>(srm, context);
if (((Message) message).isSlowMessage()) {
((SlowMessage) message).setProgressReporter(job.getProgressReporter());
jobManager.addSlowJob(job);
} else {
jobManager.addFastJob(job);
}
}
Aggregations