未验证 提交 621ebf60 编写于 作者: T Tboy 提交者: GitHub

Merge branch 'refactor-worker' into refactor-worker

...@@ -34,7 +34,6 @@ import org.slf4j.LoggerFactory; ...@@ -34,7 +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 java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
/** /**
...@@ -60,6 +59,9 @@ public class MasterSchedulerService extends Thread { ...@@ -60,6 +59,9 @@ public class MasterSchedulerService extends Thread {
@Autowired @Autowired
private ZKMasterClient zkMasterClient; private ZKMasterClient zkMasterClient;
@Autowired
private MasterConfig masterConfig;
/** /**
* master config * master config
*/ */
...@@ -69,18 +71,17 @@ public class MasterSchedulerService extends Thread { ...@@ -69,18 +71,17 @@ public class MasterSchedulerService extends Thread {
/** /**
* netty remoting client * netty remoting client
*/ */
private NettyRemotingClient nettyRemotingClient; private final NettyRemotingClient nettyRemotingClient;
/** /**
* master exec service * master exec service
*/ */
private ThreadPoolExecutor masterExecService; 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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册