@Test public void assertGetExecutionInfoWithoutMonitorExecution() { when(registryCenter.isExisted("/testJob/execution")).thenReturn(false); assertTrue(jobStatisticsAPI.getExecutionInfo("testJob").isEmpty()); }
@Override public Collection<ExecutionInfo> getExecutionInfo(final String jobName) { String executionRootPath = new JobNodePath(jobName).getExecutionNodePath(); if (!registryCenter.isExisted(executionRootPath)) { return Collections.emptyList(); } List<String> items = registryCenter.getChildrenKeys(executionRootPath); List<ExecutionInfo> result = new ArrayList<>(items.size()); for (String each : items) { result.add(getExecutionInfo(jobName, each)); } Collections.sort(result); return result; }
JobStatisticsAPIImpl implements JobStatisticsAPI { @Override public Collection<ExecutionInfo> getExecutionInfo(final String jobName) { String executionRootPath = new JobNodePath(jobName).getExecutionNodePath(); if (!registryCenter.isExisted(executionRootPath)) { return Collections.emptyList(); } List<String> items = registryCenter.getChildrenKeys(executionRootPath); List<ExecutionInfo> result = new ArrayList<>(items.size()); for (String each : items) { result.add(getExecutionInfo(jobName, each)); } Collections.sort(result); return result; } }
JobStatisticsAPIImpl implements JobStatisticsAPI { @Override public Collection<ExecutionInfo> getExecutionInfo(final String jobName) { String executionRootPath = new JobNodePath(jobName).getExecutionNodePath(); if (!registryCenter.isExisted(executionRootPath)) { return Collections.emptyList(); } List<String> items = registryCenter.getChildrenKeys(executionRootPath); List<ExecutionInfo> result = new ArrayList<>(items.size()); for (String each : items) { result.add(getExecutionInfo(jobName, each)); } Collections.sort(result); return result; }  }
JobStatisticsAPIImpl implements JobStatisticsAPI { @Override public Collection<ExecutionInfo> getExecutionInfo(final String jobName) { String executionRootPath = new JobNodePath(jobName).getExecutionNodePath(); if (!registryCenter.isExisted(executionRootPath)) { return Collections.emptyList(); } List<String> items = registryCenter.getChildrenKeys(executionRootPath); List<ExecutionInfo> result = new ArrayList<>(items.size()); for (String each : items) { result.add(getExecutionInfo(jobName, each)); } Collections.sort(result); return result; }  @Override Collection<JobBriefInfo> getAllJobsBriefInfo(); @Override Collection<ServerInfo> getServers(final String jobName); @Override Collection<ExecutionInfo> getExecutionInfo(final String jobName); }
JobStatisticsAPIImpl implements JobStatisticsAPI { @Override public Collection<ExecutionInfo> getExecutionInfo(final String jobName) { String executionRootPath = new JobNodePath(jobName).getExecutionNodePath(); if (!registryCenter.isExisted(executionRootPath)) { return Collections.emptyList(); } List<String> items = registryCenter.getChildrenKeys(executionRootPath); List<ExecutionInfo> result = new ArrayList<>(items.size()); for (String each : items) { result.add(getExecutionInfo(jobName, each)); } Collections.sort(result); return result; }  @Override Collection<JobBriefInfo> getAllJobsBriefInfo(); @Override Collection<ServerInfo> getServers(final String jobName); @Override Collection<ExecutionInfo> getExecutionInfo(final String jobName);  }