use of org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperHaServices in project flink by apache.
the class HighAvailabilityServicesUtils method createZooKeeperHaServices.
private static HighAvailabilityServices createZooKeeperHaServices(Configuration configuration, Executor executor, FatalErrorHandler fatalErrorHandler) throws Exception {
final boolean useOldHaServices = configuration.get(HighAvailabilityOptions.USE_OLD_HA_SERVICES);
BlobStoreService blobStoreService = BlobUtils.createBlobStoreFromConfig(configuration);
final CuratorFrameworkWithUnhandledErrorListener curatorFrameworkWrapper = ZooKeeperUtils.startCuratorFramework(configuration, fatalErrorHandler);
if (useOldHaServices) {
return new ZooKeeperHaServices(curatorFrameworkWrapper, executor, configuration, blobStoreService);
} else {
return new ZooKeeperMultipleComponentLeaderElectionHaServices(curatorFrameworkWrapper, configuration, executor, blobStoreService, fatalErrorHandler);
}
}
use of org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperHaServices in project flink by apache.
the class ZooKeeperLeaderRetrievalTest method before.
@Before
public void before() throws Exception {
testingServer = new TestingServer();
config = new Configuration();
config.setString(HighAvailabilityOptions.HA_MODE, "zookeeper");
config.setString(HighAvailabilityOptions.HA_ZOOKEEPER_QUORUM, testingServer.getConnectString());
highAvailabilityServices = new ZooKeeperHaServices(ZooKeeperUtils.startCuratorFramework(config, testingFatalErrorHandlerResource.getFatalErrorHandler()), TestingUtils.defaultExecutor(), config, new VoidBlobStore());
}
Aggregations