|
|
|
@ -77,6 +77,18 @@ public class MasterServer implements IStoppable {
|
|
|
|
|
@Autowired |
|
|
|
|
private TaskAckProcessor taskAckProcessor; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private TaskResponseProcessor taskResponseProcessor; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private TaskEventProcessor taskEventProcessor; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private StateEventProcessor stateEventProcessor; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private CacheProcessor cacheProcessor; |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
Thread.currentThread().setName(Constants.THREAD_NAME_MASTER_SERVER); |
|
|
|
|
SpringApplication.run(MasterServer.class); |
|
|
|
@ -91,13 +103,13 @@ public class MasterServer implements IStoppable {
|
|
|
|
|
NettyServerConfig serverConfig = new NettyServerConfig(); |
|
|
|
|
serverConfig.setListenPort(masterConfig.getListenPort()); |
|
|
|
|
this.nettyRemotingServer = new NettyRemotingServer(serverConfig); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RESPONSE, new TaskResponseProcessor()); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RESPONSE, taskResponseProcessor); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_ACK, taskAckProcessor); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_RESPONSE, new TaskKillResponseProcessor()); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.STATE_EVENT_REQUEST, new StateEventProcessor()); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_FORCE_STATE_EVENT_REQUEST, new TaskEventProcessor()); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_WAKEUP_EVENT_REQUEST, new TaskEventProcessor()); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.CACHE_EXPIRE, new CacheProcessor()); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.STATE_EVENT_REQUEST, stateEventProcessor); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_FORCE_STATE_EVENT_REQUEST, taskEventProcessor); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_WAKEUP_EVENT_REQUEST, taskEventProcessor); |
|
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.CACHE_EXPIRE, cacheProcessor); |
|
|
|
|
this.nettyRemotingServer.start(); |
|
|
|
|
|
|
|
|
|
// self tolerant
|
|
|
|
|