|
|
@ -34,8 +34,6 @@ import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.PostConstruct; |
|
|
|
|
|
|
|
import javax.annotation.PreDestroy; |
|
|
|
|
|
|
|
import java.util.concurrent.ThreadPoolExecutor; |
|
|
|
import java.util.concurrent.ThreadPoolExecutor; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -49,11 +47,6 @@ public class MasterSchedulerService extends Thread { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private static final Logger logger = LoggerFactory.getLogger(MasterSchedulerService.class); |
|
|
|
private static final Logger logger = LoggerFactory.getLogger(MasterSchedulerService.class); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* master exec service |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private ThreadPoolExecutor masterExecService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* dolphinscheduler database interface
|
|
|
|
* dolphinscheduler database interface
|
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -66,28 +59,33 @@ public class MasterSchedulerService extends Thread { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private ZKMasterClient zkMasterClient; |
|
|
|
private ZKMasterClient zkMasterClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private MasterConfig masterConfig; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* netty remoting client |
|
|
|
* netty remoting client |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private NettyRemotingClient nettyRemotingClient; |
|
|
|
private final NettyRemotingClient nettyRemotingClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
/** |
|
|
|
private MasterConfig masterConfig; |
|
|
|
* master exec service |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private final ThreadPoolExecutor masterExecService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* constructor of MasterSchedulerThread |
|
|
|
* constructor of MasterSchedulerThread |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@PostConstruct |
|
|
|
public MasterSchedulerService(){ |
|
|
|
public void init(){ |
|
|
|
|
|
|
|
this.masterExecService = (ThreadPoolExecutor)ThreadUtils.newDaemonFixedThreadExecutor("Master-Exec-Thread", masterConfig.getMasterExecThreads()); |
|
|
|
this.masterExecService = (ThreadPoolExecutor)ThreadUtils.newDaemonFixedThreadExecutor("Master-Exec-Thread", masterConfig.getMasterExecThreads()); |
|
|
|
NettyClientConfig clientConfig = new NettyClientConfig(); |
|
|
|
NettyClientConfig clientConfig = new NettyClientConfig(); |
|
|
|
this.nettyRemotingClient = new NettyRemotingClient(clientConfig); |
|
|
|
this.nettyRemotingClient = new NettyRemotingClient(clientConfig); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void start(){ |
|
|
|
super.setName("MasterSchedulerThread"); |
|
|
|
super.setName("MasterSchedulerThread"); |
|
|
|
super.start(); |
|
|
|
super.start(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PreDestroy |
|
|
|
|
|
|
|
public void close(){ |
|
|
|
public void close(){ |
|
|
|
nettyRemotingClient.close(); |
|
|
|
nettyRemotingClient.close(); |
|
|
|
logger.info("master schedule service stopped..."); |
|
|
|
logger.info("master schedule service stopped..."); |
|
|
|