@Test public void assertTriggerWithJobName() { when(regCenter.getChildrenKeys("/test_job/instances")).thenReturn(Arrays.asList("ip1@-@defaultInstance", "ip2@-@defaultInstance")); jobOperateAPI.trigger("test_job"); verify(regCenter).getChildrenKeys("/test_job/instances"); verify(regCenter).persist("/test_job/instances/ip1@-@defaultInstance", "TRIGGER"); verify(regCenter).persist("/test_job/instances/ip2@-@defaultInstance", "TRIGGER"); }
@Override public void trigger(final String jobName) { Preconditions.checkNotNull(jobName, "Job name cannot be null"); JobNodePath jobNodePath = new JobNodePath(jobName); for (String each : regCenter.getChildrenKeys(jobNodePath.getInstancesNodePath())) { regCenter.persist(jobNodePath.getInstanceNodePath(each), "TRIGGER"); } }
JobOperateAPIImpl implements JobOperateAPI { @Override public void trigger(final String jobName) { Preconditions.checkNotNull(jobName, "Job name cannot be null"); JobNodePath jobNodePath = new JobNodePath(jobName); for (String each : regCenter.getChildrenKeys(jobNodePath.getInstancesNodePath())) { regCenter.persist(jobNodePath.getInstanceNodePath(each), "TRIGGER"); } } }
JobOperateAPIImpl implements JobOperateAPI { @Override public void trigger(final String jobName) { Preconditions.checkNotNull(jobName, "Job name cannot be null"); JobNodePath jobNodePath = new JobNodePath(jobName); for (String each : regCenter.getChildrenKeys(jobNodePath.getInstancesNodePath())) { regCenter.persist(jobNodePath.getInstanceNodePath(each), "TRIGGER"); } } JobOperateAPIImpl(final CoordinatorRegistryCenter regCenter); }
JobOperateAPIImpl implements JobOperateAPI { @Override public void trigger(final String jobName) { Preconditions.checkNotNull(jobName, "Job name cannot be null"); JobNodePath jobNodePath = new JobNodePath(jobName); for (String each : regCenter.getChildrenKeys(jobNodePath.getInstancesNodePath())) { regCenter.persist(jobNodePath.getInstanceNodePath(each), "TRIGGER"); } } JobOperateAPIImpl(final CoordinatorRegistryCenter regCenter); @Override void trigger(final String jobName); @Override void disable(final String jobName, final String serverIp); @Override void enable(final String jobName, final String serverIp); @Override void shutdown(final String jobName, final String serverIp); @Override void remove(final String jobName, final String serverIp); }
JobOperateAPIImpl implements JobOperateAPI { @Override public void trigger(final String jobName) { Preconditions.checkNotNull(jobName, "Job name cannot be null"); JobNodePath jobNodePath = new JobNodePath(jobName); for (String each : regCenter.getChildrenKeys(jobNodePath.getInstancesNodePath())) { regCenter.persist(jobNodePath.getInstanceNodePath(each), "TRIGGER"); } } JobOperateAPIImpl(final CoordinatorRegistryCenter regCenter); @Override void trigger(final String jobName); @Override void disable(final String jobName, final String serverIp); @Override void enable(final String jobName, final String serverIp); @Override void shutdown(final String jobName, final String serverIp); @Override void remove(final String jobName, final String serverIp);  }