Skip to content

Commit

Permalink
convertFromConfig should support an overloading of cluster Name (apac…
Browse files Browse the repository at this point in the history
…he#7890)

Co-authored-by: Sanjeev Kulkarni <[email protected]>
  • Loading branch information
srkukarni and Sanjeev Kulkarni authored Aug 27, 2020
1 parent 23dc5c7 commit 8c91197
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.bookkeeper.common.util.OrderedExecutor;
import org.apache.pulsar.broker.PulsarServerException;
import org.apache.pulsar.broker.ServiceConfiguration;
import org.apache.pulsar.broker.authentication.AuthenticationService;
import org.apache.pulsar.broker.authorization.AuthorizationService;
import org.apache.pulsar.broker.cache.ConfigurationCacheService;
Expand Down Expand Up @@ -179,13 +180,13 @@ private AuthorizationService getAuthorizationService() throws PulsarServerExcept
}

this.configurationCacheService = new ConfigurationCacheService(this.globalZkCache, this.workerConfig.getPulsarFunctionsCluster());
return new AuthorizationService(PulsarConfigurationLoader.convertFrom(workerConfig), this.configurationCacheService);
return new AuthorizationService(getServiceConfiguration(), this.configurationCacheService);
}
return null;
}

private AuthenticationService getAuthenticationService() throws PulsarServerException {
return new AuthenticationService(PulsarConfigurationLoader.convertFrom(workerConfig));
return new AuthenticationService(getServiceConfiguration());
}

public ZooKeeperClientFactory getZooKeeperClientFactory() {
Expand Down Expand Up @@ -223,4 +224,10 @@ public Optional<Integer> getListenPortHTTP() {
public Optional<Integer> getListenPortHTTPS() {
return this.server.getListenPortHTTPS();
}

private ServiceConfiguration getServiceConfiguration() {
ServiceConfiguration serviceConfiguration = PulsarConfigurationLoader.convertFrom(workerConfig);
serviceConfiguration.setClusterName(workerConfig.getPulsarFunctionsCluster());
return serviceConfiguration;
}
}

0 comments on commit 8c91197

Please sign in to comment.