Search in sources :

Example 1 with ZooKeeperUtilityFactory

use of org.apache.flink.runtime.zookeeper.ZooKeeperUtilityFactory in project flink by apache.

the class MesosServicesUtils method createMesosServices.

/**
	 * Creates a {@link MesosServices} instance depending on the high availability settings.
	 *
	 * @param configuration containing the high availability settings
	 * @return a mesos services instance
	 * @throws Exception if the mesos services instance could not be created
	 */
public static MesosServices createMesosServices(Configuration configuration) throws Exception {
    HighAvailabilityMode highAvailabilityMode = HighAvailabilityMode.fromConfig(configuration);
    switch(highAvailabilityMode) {
        case NONE:
            return new StandaloneMesosServices();
        case ZOOKEEPER:
            final String zkMesosRootPath = ConfigurationUtil.getStringWithDeprecatedKeys(configuration, ConfigConstants.HA_ZOOKEEPER_MESOS_WORKERS_PATH, ConfigConstants.DEFAULT_ZOOKEEPER_MESOS_WORKERS_PATH, ConfigConstants.ZOOKEEPER_MESOS_WORKERS_PATH);
            ZooKeeperUtilityFactory zooKeeperUtilityFactory = new ZooKeeperUtilityFactory(configuration, zkMesosRootPath);
            return new ZooKeeperMesosServices(zooKeeperUtilityFactory);
        default:
            throw new Exception("High availability mode " + highAvailabilityMode + " is not supported.");
    }
}
Also used : HighAvailabilityMode(org.apache.flink.runtime.jobmanager.HighAvailabilityMode) ZooKeeperUtilityFactory(org.apache.flink.runtime.zookeeper.ZooKeeperUtilityFactory)

Aggregations

HighAvailabilityMode (org.apache.flink.runtime.jobmanager.HighAvailabilityMode)1 ZooKeeperUtilityFactory (org.apache.flink.runtime.zookeeper.ZooKeeperUtilityFactory)1