use of com.dangdang.ddframe.job.lite.internal.storage.JobNodePath in project elastic-job by dangdangdotcom.
the class ServerStatisticsAPIImpl method getJobs.
@Override
public Collection<ServerInfo> getJobs(final String serverIp) {
List<String> jobs = regCenter.getChildrenKeys("/");
Collection<ServerInfo> result = new ArrayList<>(jobs.size());
for (String each : jobs) {
JobNodePath jobNodePath = new JobNodePath(each);
if (regCenter.isExisted(jobNodePath.getServerNodePath(serverIp))) {
result.add(getJob(serverIp, each));
}
}
return result;
}
use of com.dangdang.ddframe.job.lite.internal.storage.JobNodePath in project elastic-job by dangdangdotcom.
the class JobStatisticsAPIImpl method getExecutionInfo.
@Override
public Collection<ExecutionInfo> getExecutionInfo(final String jobName) {
String executionRootPath = new JobNodePath(jobName).getExecutionNodePath();
if (!regCenter.isExisted(executionRootPath)) {
return Collections.emptyList();
}
List<String> items = regCenter.getChildrenKeys(executionRootPath);
List<ExecutionInfo> result = new ArrayList<>(items.size());
for (String each : items) {
result.add(getExecutionInfo(jobName, each));
}
Collections.sort(result);
return result;
}
Aggregations