Skip to content

Commit

Permalink
优化JobTracker吞吐量[性能优化]
Browse files Browse the repository at this point in the history
  • Loading branch information
qq254963746 committed Nov 7, 2016
1 parent 688b9aa commit 689663b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public RestfulResponse cronJobSuspend(JobQueueReq request) {
appContext.getSuspendJobQueue().add(jobPo);
} catch (DupEntryException e) {
LOGGER.error(e.getMessage(), e);
return Builder.build(false, "改任务已经被暂停, 请检查暂停队列");
return Builder.build(false, "该任务已经被暂停, 请检查暂停队列");
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return Builder.build(false, "移动任务到暂停队列失败, error:" + e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void start() throws HttpCmdException {
// 开启监听命令
acceptor = new HttpCmdAcceptor(getServerSocket(), context);
acceptor.start();
LOGGER.info("===========================================================================================\n" +
LOGGER.info("\n===========================================================================================\n" +
"Start succeed at port {}\n" +
"===========================================================================================", port);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ public SendResult send(String taskTrackerNodeGroup, String taskTrackerIdentity,
SendResult sendResult = invoker.invoke(jobPos);

if (sendResult.isSuccess()) {
List<JobLogPo> jobLogPos = new ArrayList<JobLogPo>(jobPos.size());
for (JobPo jobPo : jobPos) {
// 记录日志
JobLogPo jobLogPo = JobDomainConverter.convertJobLog(jobPo);
jobLogPo.setSuccess(true);
jobLogPo.setLogType(LogType.SENT);
jobLogPo.setLogTime(SystemClock.now());
jobLogPo.setLevel(Level.INFO);
appContext.getJobLogger().log(jobLogPo);
jobLogPos.add(jobLogPo);
}
appContext.getJobLogger().log(jobLogPos);
}
return sendResult;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ private void resumeJob(JobPo jobPo) {
boolean needResume = true;
try {
jobPo.setIsRunning(true);
jobPo.setGmtModified(SystemClock.now());
appContext.getExecutableJobQueue().add(jobPo);
} catch (DupEntryException e) {
LOGGER.warn("ExecutableJobQueue already exist:" + JSON.toJSONString(jobPo));
Expand Down

0 comments on commit 689663b

Please sign in to comment.