@Test public void failureMechanismNotInvokedIfOneNodeIsTheLeader() { when(checker1.getFreshTimestampFromNodeForClient(CLIENT.value())).then(getNextTimestamp()); when(checker2.getFreshTimestampFromNodeForClient(CLIENT.value())).thenReturn(OptionalLong.empty()); noSimultaneousServiceCheck.processHealthCheckDigest(DIGEST); verify(failureMechanism, never()).accept(anyString()); }
public void processHealthCheckDigest(HealthCheckDigest digest) { Set<Client> clientsWithMultipleLeaders = digest.statusesToClient().get(TimeLockStatus.MULTIPLE_LEADERS); if (clientsWithMultipleLeaders.isEmpty()) { return; } log.info("Clients {} appear to have multiple leaders based on the leader ping health check. Scheduling" + " checks on these specific clients now.", SafeArg.of("clients", clientsWithMultipleLeaders)); clientsWithMultipleLeaders.forEach(this::scheduleCheckOnSpecificClient); }
NoSimultaneousServiceCheck { public void processHealthCheckDigest(HealthCheckDigest digest) { Set<Client> clientsWithMultipleLeaders = digest.statusesToClient().get(TimeLockStatus.MULTIPLE_LEADERS); if (clientsWithMultipleLeaders.isEmpty()) { return; } log.info("Clients {} appear to have multiple leaders based on the leader ping health check. Scheduling" + " checks on these specific clients now.", SafeArg.of("clients", clientsWithMultipleLeaders)); clientsWithMultipleLeaders.forEach(this::scheduleCheckOnSpecificClient); } }
NoSimultaneousServiceCheck { public void processHealthCheckDigest(HealthCheckDigest digest) { Set<Client> clientsWithMultipleLeaders = digest.statusesToClient().get(TimeLockStatus.MULTIPLE_LEADERS); if (clientsWithMultipleLeaders.isEmpty()) { return; } log.info("Clients {} appear to have multiple leaders based on the leader ping health check. Scheduling" + " checks on these specific clients now.", SafeArg.of("clients", clientsWithMultipleLeaders)); clientsWithMultipleLeaders.forEach(this::scheduleCheckOnSpecificClient); } @VisibleForTesting  NoSimultaneousServiceCheck(
            List<TimeLockActivityChecker> timeLockActivityCheckers,
            Consumer<String> failureMechanism,
            ExecutorService executorService,
            Duration backoff); }
NoSimultaneousServiceCheck { public void processHealthCheckDigest(HealthCheckDigest digest) { Set<Client> clientsWithMultipleLeaders = digest.statusesToClient().get(TimeLockStatus.MULTIPLE_LEADERS); if (clientsWithMultipleLeaders.isEmpty()) { return; } log.info("Clients {} appear to have multiple leaders based on the leader ping health check. Scheduling" + " checks on these specific clients now.", SafeArg.of("clients", clientsWithMultipleLeaders)); clientsWithMultipleLeaders.forEach(this::scheduleCheckOnSpecificClient); } @VisibleForTesting  NoSimultaneousServiceCheck(
            List<TimeLockActivityChecker> timeLockActivityCheckers,
            Consumer<String> failureMechanism,
            ExecutorService executorService,
            Duration backoff); static NoSimultaneousServiceCheck create(List<TimeLockActivityChecker> timeLockActivityCheckers); void processHealthCheckDigest(HealthCheckDigest digest); }
NoSimultaneousServiceCheck { public void processHealthCheckDigest(HealthCheckDigest digest) { Set<Client> clientsWithMultipleLeaders = digest.statusesToClient().get(TimeLockStatus.MULTIPLE_LEADERS); if (clientsWithMultipleLeaders.isEmpty()) { return; } log.info("Clients {} appear to have multiple leaders based on the leader ping health check. Scheduling" + " checks on these specific clients now.", SafeArg.of("clients", clientsWithMultipleLeaders)); clientsWithMultipleLeaders.forEach(this::scheduleCheckOnSpecificClient); } @VisibleForTesting  NoSimultaneousServiceCheck(
            List<TimeLockActivityChecker> timeLockActivityCheckers,
            Consumer<String> failureMechanism,
            ExecutorService executorService,
            Duration backoff); static NoSimultaneousServiceCheck create(List<TimeLockActivityChecker> timeLockActivityCheckers); void processHealthCheckDigest(HealthCheckDigest digest);  }