Skip to content

Commit 7a88def

Browse files
author
胡贵
committed
LTS admin 日志查询, 各种任务列表展示 和 查询 mongo实现,修复 ping bug, 推荐使用mongo做任务队列
1 parent 2a96e7e commit 7a88def

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lts-job-tracker/src/main/java/com/lts/job/tracker/processor/JobPullProcessor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import com.lts.job.remoting.exception.RemotingCommandException;
77
import com.lts.job.remoting.protocol.RemotingCommand;
88
import com.lts.job.tracker.domain.JobTrackerApplication;
9-
import com.lts.job.tracker.support.JobDistributor;
9+
import com.lts.job.tracker.support.JobPusher;
1010
import io.netty.channel.ChannelHandlerContext;
1111

1212
/**
@@ -15,20 +15,20 @@
1515
*/
1616
public class JobPullProcessor extends AbstractProcessor {
1717

18-
private JobDistributor jobDistributor;
18+
private JobPusher jobPusher;
1919

2020
public JobPullProcessor(RemotingServerDelegate remotingServer, JobTrackerApplication application) {
2121
super(remotingServer, application);
2222

23-
jobDistributor = new JobDistributor(application);
23+
jobPusher = new JobPusher(application);
2424
}
2525

2626
@Override
2727
public RemotingCommand processRequest(final ChannelHandlerContext ctx, final RemotingCommand request) throws RemotingCommandException {
2828

2929
JobPullRequest requestBody = request.getBody();
3030

31-
jobDistributor.distribute(remotingServer, requestBody);
31+
jobPusher.push(remotingServer, requestBody);
3232

3333
return RemotingCommand.createResponseCommand(JobProtos.ResponseCode.JOB_PULL_SUCCESS.code(), "");
3434
}

lts-job-tracker/src/main/java/com/lts/job/tracker/support/JobDistributor.java renamed to lts-job-tracker/src/main/java/com/lts/job/tracker/support/JobPusher.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,24 @@
3232
* @author Robert HG (254963746@qq.com) on 8/18/14.
3333
* 任务分发管理
3434
*/
35-
public class JobDistributor {
35+
public class JobPusher {
3636

37-
private final Logger LOGGER = LoggerFactory.getLogger(JobDistributor.class);
37+
private final Logger LOGGER = LoggerFactory.getLogger(JobPusher.class);
3838
private JobTrackerApplication application;
3939
private final ExecutorService executor;
4040

41-
public JobDistributor(JobTrackerApplication application) {
41+
public JobPusher(JobTrackerApplication application) {
4242
this.application = application;
4343
executor = Executors.newFixedThreadPool(Constants.AVAILABLE_PROCESSOR * 5
44-
, new NamedThreadFactory(JobDistributor.class.getSimpleName()));
44+
, new NamedThreadFactory(JobPusher.class.getSimpleName()));
4545
}
4646

47-
public void distribute(final RemotingServerDelegate remotingServer, final JobPullRequest request) {
47+
public void push(final RemotingServerDelegate remotingServer, final JobPullRequest request) {
4848
executor.submit(new Runnable() {
4949
@Override
5050
public void run() {
5151
try {
52-
_sendJob(remotingServer, request);
52+
pushJob(remotingServer, request);
5353
} catch (Exception e) {
5454
LOGGER.error(e.getMessage(), e);
5555
}
@@ -64,7 +64,7 @@ public void run() {
6464
* @param remotingServer
6565
* @param request
6666
*/
67-
private void _sendJob(RemotingServerDelegate remotingServer, JobPullRequest request) {
67+
private void pushJob(RemotingServerDelegate remotingServer, JobPullRequest request) {
6868

6969
String nodeGroup = request.getNodeGroup();
7070
String identity = request.getIdentity();

0 commit comments

Comments
 (0)