|
|
|
@ -17,10 +17,13 @@
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.server.worker; |
|
|
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_DRIVER_CLASS_NAME; |
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.Constants; |
|
|
|
|
import org.apache.dolphinscheduler.common.IStoppable; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.NodeType; |
|
|
|
|
import org.apache.dolphinscheduler.common.thread.Stopper; |
|
|
|
|
import org.apache.dolphinscheduler.common.utils.PropertyUtils; |
|
|
|
|
import org.apache.dolphinscheduler.remote.NettyRemotingServer; |
|
|
|
|
import org.apache.dolphinscheduler.remote.command.CommandType; |
|
|
|
|
import org.apache.dolphinscheduler.remote.config.NettyServerConfig; |
|
|
|
@ -35,6 +38,7 @@ import org.apache.dolphinscheduler.service.bean.SpringApplicationContext;
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
import org.springframework.boot.WebApplicationType; |
|
|
|
|
import org.springframework.boot.builder.SpringApplicationBuilder; |
|
|
|
|
import org.springframework.context.annotation.ComponentScan; |
|
|
|
@ -101,6 +105,9 @@ public class WorkerServer implements IStoppable {
|
|
|
|
|
@Autowired |
|
|
|
|
private TaskPluginManager taskPluginManager; |
|
|
|
|
|
|
|
|
|
@Value("${spring.datasource.driver-class-name}") |
|
|
|
|
private String driverClassName; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* worker server startup, not use web service |
|
|
|
|
* |
|
|
|
@ -119,6 +126,8 @@ public class WorkerServer implements IStoppable {
|
|
|
|
|
*/ |
|
|
|
|
@PostConstruct |
|
|
|
|
public void run() { |
|
|
|
|
PropertyUtils.setValue(SPRING_DATASOURCE_DRIVER_CLASS_NAME, driverClassName); |
|
|
|
|
|
|
|
|
|
// alert-server client registry
|
|
|
|
|
alertClientService = new AlertClientService(workerConfig.getAlertListenHost(), Constants.ALERT_RPC_PORT); |
|
|
|
|
|
|
|
|
|