Search in sources :

Example 1 with GlobalZooKeeperCache

use of com.yahoo.pulsar.zookeeper.GlobalZooKeeperCache in project pulsar by yahoo.

the class PulsarService method startZkCacheService.

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

Example 2 with GlobalZooKeeperCache

use of com.yahoo.pulsar.zookeeper.GlobalZooKeeperCache in project pulsar by yahoo.

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 authorizationManager
    if (config.isAuthorizationEnabled()) {
        if (configurationCacheService == null) {
            throw new PulsarServerException("Failed to initialize authorization manager due to empty GlobalZookeeperServers");
        }
        authorizationManager = new AuthorizationManager(this.config, configurationCacheService);
    }
    // start authentication service
    authenticationService = new AuthenticationService(this.config);
    log.info("Pulsar WebSocket Service started");
}
Also used : PulsarServerException(com.yahoo.pulsar.broker.PulsarServerException) GlobalZooKeeperCache(com.yahoo.pulsar.zookeeper.GlobalZooKeeperCache) ConfigurationCacheService(com.yahoo.pulsar.broker.cache.ConfigurationCacheService) IOException(java.io.IOException) AuthorizationManager(com.yahoo.pulsar.broker.authorization.AuthorizationManager) AuthenticationService(com.yahoo.pulsar.broker.authentication.AuthenticationService)

Aggregations

ConfigurationCacheService (com.yahoo.pulsar.broker.cache.ConfigurationCacheService)2 GlobalZooKeeperCache (com.yahoo.pulsar.zookeeper.GlobalZooKeeperCache)2 IOException (java.io.IOException)2 PulsarServerException (com.yahoo.pulsar.broker.PulsarServerException)1 AuthenticationService (com.yahoo.pulsar.broker.authentication.AuthenticationService)1 AuthorizationManager (com.yahoo.pulsar.broker.authorization.AuthorizationManager)1 LocalZooKeeperCacheService (com.yahoo.pulsar.broker.cache.LocalZooKeeperCacheService)1 LocalZooKeeperCache (com.yahoo.pulsar.zookeeper.LocalZooKeeperCache)1