class HighAvailabilityServicesUtils {

	private static ClientHighAvailabilityServices createCustomClientHAServices(Configuration config) throws FlinkException {
		final HighAvailabilityServicesFactory highAvailabilityServicesFactory = loadCustomHighAvailabilityServicesFactory(
			config.getString(HighAvailabilityOptions.HA_MODE));

		try {
			return highAvailabilityServicesFactory.createClientHAServices(config);
		} catch (Exception e) {
			throw new FlinkException(
				String.format(
					"Could not create the client ha services from the instantiated HighAvailabilityServicesFactory %s.",
					highAvailabilityServicesFactory.getClass().getName()),
				e);
		}
	}

}