@Test public void assertSetCrashedFailoverFlagWhenItemIsNotAssigned() { when(jobNodeStorage.isJobNodeExisted("sharding/0/failover")).thenReturn(true); failoverService.setCrashedFailoverFlag(0); verify(jobNodeStorage).isJobNodeExisted("sharding/0/failover"); verify(jobNodeStorage, times(0)).createJobNodeIfNeeded("leader/failover/items/0"); }
public void setCrashedFailoverFlag(final int item) { if (!isFailoverAssigned(item)) { jobNodeStorage.createJobNodeIfNeeded(FailoverNode.getItemsNode(item)); } }
FailoverService { public void setCrashedFailoverFlag(final int item) { if (!isFailoverAssigned(item)) { jobNodeStorage.createJobNodeIfNeeded(FailoverNode.getItemsNode(item)); } } }
FailoverService { public void setCrashedFailoverFlag(final int item) { if (!isFailoverAssigned(item)) { jobNodeStorage.createJobNodeIfNeeded(FailoverNode.getItemsNode(item)); } } FailoverService(final CoordinatorRegistryCenter regCenter, final String jobName); }
FailoverService { public void setCrashedFailoverFlag(final int item) { if (!isFailoverAssigned(item)) { jobNodeStorage.createJobNodeIfNeeded(FailoverNode.getItemsNode(item)); } } FailoverService(final CoordinatorRegistryCenter regCenter, final String jobName); void setCrashedFailoverFlag(final int item); void failoverIfNecessary(); void updateFailoverComplete(final Collection<Integer> items); List<Integer> getFailoverItems(final String jobInstanceId); List<Integer> getLocalFailoverItems(); List<Integer> getLocalTakeOffItems(); void removeFailoverInfo(); }
FailoverService { public void setCrashedFailoverFlag(final int item) { if (!isFailoverAssigned(item)) { jobNodeStorage.createJobNodeIfNeeded(FailoverNode.getItemsNode(item)); } } FailoverService(final CoordinatorRegistryCenter regCenter, final String jobName); void setCrashedFailoverFlag(final int item); void failoverIfNecessary(); void updateFailoverComplete(final Collection<Integer> items); List<Integer> getFailoverItems(final String jobInstanceId); List<Integer> getLocalFailoverItems(); List<Integer> getLocalTakeOffItems(); void removeFailoverInfo();  }