Skip to content

Commit

Permalink
#54 reduce zookeeper load by optimizing the read/write during the exe…
Browse files Browse the repository at this point in the history
…cution of the job
  • Loading branch information
chembohuang committed Jan 10, 2017
1 parent 1d648de commit 192a67d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,17 @@ public Collection<ExecutionInfo> getExecutionInfo(final String jobName) {
if(JobStatus.STOPPED.equals(getJobStatus(jobName))){
return Collections.emptyList();
}
// update report node
curatorFrameworkOp.update(JobNodePath.getReportPath(jobName), System.currentTimeMillis());
try {
Thread.sleep(500);
} catch (InterruptedException e) {
log.error(e.getMessage(), e);
}
String executionRootpath = JobNodePath.getExecutionNodePath(jobName);
if (!curatorFrameworkOp.checkExists(executionRootpath)) {
return Collections.emptyList();
}
// update report node
curatorFrameworkOp.update(JobNodePath.getReportPath(jobName), System.currentTimeMillis());

List<String> items = curatorFrameworkOp.getChildren(executionRootpath);
List<ExecutionInfo> result = new ArrayList<>(items.size());
Expand Down

0 comments on commit 192a67d

Please sign in to comment.