@Test public void assertFailoverIfUnnecessaryWhenItemsRootNodeNotExisted() { when(jobNodeStorage.isJobNodeExisted("leader/failover/items")).thenReturn(false); failoverService.failoverIfNecessary(); verify(jobNodeStorage).isJobNodeExisted("leader/failover/items"); verify(jobNodeStorage, times(0)).executeInLeader(eq("leader/failover/latch"), ArgumentMatchers.<FailoverService.FailoverLeaderExecutionCallback>any()); }
public void failoverIfNecessary() { if (needFailover()) { jobNodeStorage.executeInLeader(FailoverNode.LATCH, new FailoverLeaderExecutionCallback()); } }
FailoverService { public void failoverIfNecessary() { if (needFailover()) { jobNodeStorage.executeInLeader(FailoverNode.LATCH, new FailoverLeaderExecutionCallback()); } } }
FailoverService { public void failoverIfNecessary() { if (needFailover()) { jobNodeStorage.executeInLeader(FailoverNode.LATCH, new FailoverLeaderExecutionCallback()); } } FailoverService(final CoordinatorRegistryCenter regCenter, final String jobName); }
FailoverService { public void failoverIfNecessary() { if (needFailover()) { jobNodeStorage.executeInLeader(FailoverNode.LATCH, new FailoverLeaderExecutionCallback()); } } 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 failoverIfNecessary() { if (needFailover()) { jobNodeStorage.executeInLeader(FailoverNode.LATCH, new FailoverLeaderExecutionCallback()); } } 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();  }