private void throwIfInvalidSetup(PingableLeader cachedService, PingableLeader pingedService, String pingedServiceUuid) { if (cachedService == null) { return; } IllegalStateException exception = new IllegalStateException( "There is a fatal problem with the leadership election configuration! " + "This is probably caused by invalid pref files setting up the cluster " + "(e.g. for lock server look at lock.prefs, leader.prefs, and lock_client.prefs)." + "If the preferences are specified with a host port pair list and localhost index " + "then make sure that the localhost index is correct (e.g. actually the localhost)."); if (cachedService != pingedService) { log.error("Remote potential leaders are claiming to be each other!", exception); throw Throwables.rewrap(exception); } if (pingedServiceUuid.equals(getUUID())) { log.error("Remote potential leader is claiming to be you!", exception); throw Throwables.rewrap(exception); } }
private void throwIfInvalidSetup(PingableLeader cachedService, PingableLeader pingedService, String pingedServiceUuid) { if (cachedService == null) { return; } IllegalStateException exception = new IllegalStateException( "There is a fatal problem with the leadership election configuration! " + "This is probably caused by invalid pref files setting up the cluster " + "(e.g. for lock server look at lock.prefs, leader.prefs, and lock_client.prefs)." + "If the preferences are specified with a host port pair list and localhost index " + "then make sure that the localhost index is correct (e.g. actually the localhost)."); if (cachedService != pingedService) { log.error("Remote potential leaders are claiming to be each other!", exception); throw Throwables.rewrap(exception); } if (pingedServiceUuid.equals(getUUID())) { log.error("Remote potential leader is claiming to be you!", exception); throw Throwables.rewrap(exception); } }