|
|
@ -103,11 +103,14 @@ public class WorkerServer { |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
logger.info("start worker server..."); |
|
|
|
logger.info("start worker server..."); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//alert-server client registry
|
|
|
|
|
|
|
|
alertClientService = new AlertClientService(workerConfig.getAlertListenHost(),Constants.ALERT_RPC_PORT); |
|
|
|
|
|
|
|
|
|
|
|
//init remoting server
|
|
|
|
//init remoting server
|
|
|
|
NettyServerConfig serverConfig = new NettyServerConfig(); |
|
|
|
NettyServerConfig serverConfig = new NettyServerConfig(); |
|
|
|
serverConfig.setListenPort(workerConfig.getListenPort()); |
|
|
|
serverConfig.setListenPort(workerConfig.getListenPort()); |
|
|
|
this.nettyRemotingServer = new NettyRemotingServer(serverConfig); |
|
|
|
this.nettyRemotingServer = new NettyRemotingServer(serverConfig); |
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_REQUEST, new TaskExecuteProcessor()); |
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_REQUEST, new TaskExecuteProcessor(alertClientService)); |
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_REQUEST, new TaskKillProcessor()); |
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_REQUEST, new TaskKillProcessor()); |
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.DB_TASK_ACK, new DBTaskAckProcessor()); |
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.DB_TASK_ACK, new DBTaskAckProcessor()); |
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.DB_TASK_RESPONSE, new DBTaskResponseProcessor()); |
|
|
|
this.nettyRemotingServer.registerProcessor(CommandType.DB_TASK_RESPONSE, new DBTaskResponseProcessor()); |
|
|
@ -116,9 +119,6 @@ public class WorkerServer { |
|
|
|
// worker registry
|
|
|
|
// worker registry
|
|
|
|
this.workerRegistry.registry(); |
|
|
|
this.workerRegistry.registry(); |
|
|
|
|
|
|
|
|
|
|
|
//alert-server client registry
|
|
|
|
|
|
|
|
alertClientService = new AlertClientService(workerConfig.getAlertListenHost(),Constants.ALERT_RPC_PORT); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// retry report task status
|
|
|
|
// retry report task status
|
|
|
|
this.retryReportTaskStatusThread.start(); |
|
|
|
this.retryReportTaskStatusThread.start(); |
|
|
|
|
|
|
|
|
|
|
|