Search in sources :

Example 1 with ZooKeeperHaServices

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);
    }
}
Also used : ZooKeeperHaServices(org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperHaServices) CuratorFrameworkWithUnhandledErrorListener(org.apache.flink.runtime.highavailability.zookeeper.CuratorFrameworkWithUnhandledErrorListener) ZooKeeperMultipleComponentLeaderElectionHaServices(org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperMultipleComponentLeaderElectionHaServices) BlobStoreService(org.apache.flink.runtime.blob.BlobStoreService)

Example 2 with ZooKeeperHaServices

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());
}
Also used : TestingServer(org.apache.curator.test.TestingServer) ZooKeeperHaServices(org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperHaServices) VoidBlobStore(org.apache.flink.runtime.blob.VoidBlobStore) Configuration(org.apache.flink.configuration.Configuration) Before(org.junit.Before)

Aggregations

ZooKeeperHaServices (org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperHaServices)2 TestingServer (org.apache.curator.test.TestingServer)1 Configuration (org.apache.flink.configuration.Configuration)1 BlobStoreService (org.apache.flink.runtime.blob.BlobStoreService)1 VoidBlobStore (org.apache.flink.runtime.blob.VoidBlobStore)1 CuratorFrameworkWithUnhandledErrorListener (org.apache.flink.runtime.highavailability.zookeeper.CuratorFrameworkWithUnhandledErrorListener)1 ZooKeeperMultipleComponentLeaderElectionHaServices (org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperMultipleComponentLeaderElectionHaServices)1 Before (org.junit.Before)1