Search in sources :

Example 1 with GlobalZooKeeperCache

use of org.apache.pulsar.zookeeper.GlobalZooKeeperCache in project incubator-pulsar by apache.

the class PulsarService method startZkCacheService.

private void startZkCacheService() throws PulsarServerException {
    LOG.info("starting configuration cache service");
    this.localZkCache = new LocalZooKeeperCache(getZkClient(), getOrderedExecutor(), this.cacheExecutor);
    this.globalZkCache = new GlobalZooKeeperCache(getZooKeeperClientFactory(), (int) config.getZooKeeperSessionTimeoutMillis(), config.getGlobalZookeeperServers(), getOrderedExecutor(), this.cacheExecutor);
    try {
        this.globalZkCache.start();
    } catch (IOException e) {
        throw new PulsarServerException(e);
    }
    this.configurationCacheService = new ConfigurationCacheService(getGlobalZkCache(), this.config.getClusterName());
    this.localZkCacheService = new LocalZooKeeperCacheService(getLocalZkCache(), this.configurationCacheService);
}
Also used : GlobalZooKeeperCache(org.apache.pulsar.zookeeper.GlobalZooKeeperCache) LocalZooKeeperCache(org.apache.pulsar.zookeeper.LocalZooKeeperCache) ConfigurationCacheService(org.apache.pulsar.broker.cache.ConfigurationCacheService) IOException(java.io.IOException) LocalZooKeeperCacheService(org.apache.pulsar.broker.cache.LocalZooKeeperCacheService)

Example 2 with GlobalZooKeeperCache

use of org.apache.pulsar.zookeeper.GlobalZooKeeperCache in project incubator-pulsar by apache.

the class WebSocketService method start.

public void start() throws PulsarServerException, PulsarClientException, MalformedURLException, ServletException, DeploymentException {
    if (isNotBlank(config.getGlobalZookeeperServers())) {
        this.globalZkCache = new GlobalZooKeeperCache(getZooKeeperClientFactory(), (int) config.getZooKeeperSessionTimeoutMillis(), config.getGlobalZookeeperServers(), this.orderedExecutor, this.executor);
        try {
            this.globalZkCache.start();
        } catch (IOException e) {
            throw new PulsarServerException(e);
        }
        this.configurationCacheService = new ConfigurationCacheService(getGlobalZkCache());
        log.info("Global Zookeeper cache started");
    }
    // start authorizationService
    if (config.isAuthorizationEnabled()) {
        if (configurationCacheService == null) {
            throw new PulsarServerException("Failed to initialize authorization manager due to empty GlobalZookeeperServers");
        }
        authorizationService = new AuthorizationService(this.config, configurationCacheService);
    }
    // start authentication service
    authenticationService = new AuthenticationService(this.config);
    log.info("Pulsar WebSocket Service started");
}
Also used : PulsarServerException(org.apache.pulsar.broker.PulsarServerException) GlobalZooKeeperCache(org.apache.pulsar.zookeeper.GlobalZooKeeperCache) AuthorizationService(org.apache.pulsar.broker.authorization.AuthorizationService) ConfigurationCacheService(org.apache.pulsar.broker.cache.ConfigurationCacheService) IOException(java.io.IOException) AuthenticationService(org.apache.pulsar.broker.authentication.AuthenticationService)

Aggregations

IOException (java.io.IOException)2 ConfigurationCacheService (org.apache.pulsar.broker.cache.ConfigurationCacheService)2 GlobalZooKeeperCache (org.apache.pulsar.zookeeper.GlobalZooKeeperCache)2 PulsarServerException (org.apache.pulsar.broker.PulsarServerException)1 AuthenticationService (org.apache.pulsar.broker.authentication.AuthenticationService)1 AuthorizationService (org.apache.pulsar.broker.authorization.AuthorizationService)1 LocalZooKeeperCacheService (org.apache.pulsar.broker.cache.LocalZooKeeperCacheService)1 LocalZooKeeperCache (org.apache.pulsar.zookeeper.LocalZooKeeperCache)1