You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/01/26 06:58:49 UTC
[GitHub] [pulsar] nicoloboschi commented on a change in pull request #13777: Allow to configure metadata store URL in proxy.conf
nicoloboschi commented on a change in pull request #13777:
URL: https://github.com/apache/pulsar/pull/13777#discussion_r792353241
##########
File path: pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyServiceStarter.java
##########
@@ -70,16 +70,23 @@
@Parameter(names = { "-c", "--config" }, description = "Configuration file path", required = true)
private String configFile;
+ @Deprecated
@Parameter(names = { "-zk", "--zookeeper-servers" }, description = "Local zookeeper connection string")
Review comment:
Could you explain which is the successor of this parameter?
##########
File path: pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyServiceStarter.java
##########
@@ -70,16 +70,23 @@
@Parameter(names = { "-c", "--config" }, description = "Configuration file path", required = true)
private String configFile;
+ @Deprecated
@Parameter(names = { "-zk", "--zookeeper-servers" }, description = "Local zookeeper connection string")
private String zookeeperServers = "";
+ @Parameter(names = { "-md", "--metadata-store" }, description = "Metadata Store service url. eg: zk:my-zk:2181")
+ private String metadataStoreUrl = "";
@Deprecated
@Parameter(names = { "-gzk", "--global-zookeeper-servers" }, description = "Global zookeeper connection string")
private String globalZookeeperServers = "";
+ @Deprecated
@Parameter(names = { "-cs", "--configuration-store-servers" },
- description = "Configuration store connection string")
Review comment:
Could you explain which is the successor of this parameter?
##########
File path: pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyServiceStarter.java
##########
@@ -131,30 +138,35 @@ public ProxyServiceStarter(String[] args) throws Exception {
// load config file
config = PulsarConfigurationLoader.create(configFile, ProxyConfiguration.class);
- if (!isBlank(zookeeperServers)) {
- // Use zookeeperServers from command line
- config.setZookeeperServers(zookeeperServers);
+ if (isBlank(metadataStoreUrl)) {
+ // Use zookeeperServers from command line if metadataStoreUrl is empty;
+ config.setMetadataStoreUrl(zookeeperServers);
+ } else {
+ // Use metadataStoreUrl from command line
+ config.setMetadataStoreUrl(metadataStoreUrl);
}
if (!isBlank(globalZookeeperServers)) {
- // Use globalZookeeperServers from command line
- config.setConfigurationStoreServers(globalZookeeperServers);
+ config.setConfigurationMetadataStoreUrl(globalZookeeperServers);
}
if (!isBlank(configurationStoreServers)) {
- // Use configurationStoreServers from command line
- config.setConfigurationStoreServers(configurationStoreServers);
+ // Use configurationMetadataStoreUrl from command line
+ config.setConfigurationMetadataStoreUrl(configurationStoreServers);
+ }
+ if (!isBlank(configurationMetadataStoreUrl)) {
+ config.setConfigurationMetadataStoreUrl(configurationMetadataStoreUrl);
}
if ((isBlank(config.getBrokerServiceURL()) && isBlank(config.getBrokerServiceURLTLS()))
|| config.isAuthorizationEnabled()) {
- checkArgument(!isEmpty(config.getZookeeperServers()), "zookeeperServers must be provided");
- checkArgument(!isEmpty(config.getConfigurationStoreServers()),
- "configurationStoreServers must be provided");
+ checkArgument(!isEmpty(config.getMetadataStoreUrl()), "metadata store url must be provided");
Review comment:
```suggestion
checkArgument(!isEmpty(config.getMetadataStoreUrl()), "metadataStoreUrl must be provided");
```
##########
File path: pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyServiceStarter.java
##########
@@ -131,30 +138,35 @@ public ProxyServiceStarter(String[] args) throws Exception {
// load config file
config = PulsarConfigurationLoader.create(configFile, ProxyConfiguration.class);
- if (!isBlank(zookeeperServers)) {
- // Use zookeeperServers from command line
- config.setZookeeperServers(zookeeperServers);
+ if (isBlank(metadataStoreUrl)) {
Review comment:
Can you add a simple unit test to verify these changes and prevent future regressions?
##########
File path: pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyServiceStarter.java
##########
@@ -131,30 +138,35 @@ public ProxyServiceStarter(String[] args) throws Exception {
// load config file
config = PulsarConfigurationLoader.create(configFile, ProxyConfiguration.class);
- if (!isBlank(zookeeperServers)) {
- // Use zookeeperServers from command line
- config.setZookeeperServers(zookeeperServers);
+ if (isBlank(metadataStoreUrl)) {
+ // Use zookeeperServers from command line if metadataStoreUrl is empty;
+ config.setMetadataStoreUrl(zookeeperServers);
+ } else {
+ // Use metadataStoreUrl from command line
+ config.setMetadataStoreUrl(metadataStoreUrl);
}
if (!isBlank(globalZookeeperServers)) {
- // Use globalZookeeperServers from command line
- config.setConfigurationStoreServers(globalZookeeperServers);
+ config.setConfigurationMetadataStoreUrl(globalZookeeperServers);
}
if (!isBlank(configurationStoreServers)) {
- // Use configurationStoreServers from command line
- config.setConfigurationStoreServers(configurationStoreServers);
+ // Use configurationMetadataStoreUrl from command line
+ config.setConfigurationMetadataStoreUrl(configurationStoreServers);
+ }
+ if (!isBlank(configurationMetadataStoreUrl)) {
+ config.setConfigurationMetadataStoreUrl(configurationMetadataStoreUrl);
}
if ((isBlank(config.getBrokerServiceURL()) && isBlank(config.getBrokerServiceURLTLS()))
|| config.isAuthorizationEnabled()) {
- checkArgument(!isEmpty(config.getZookeeperServers()), "zookeeperServers must be provided");
- checkArgument(!isEmpty(config.getConfigurationStoreServers()),
- "configurationStoreServers must be provided");
+ checkArgument(!isEmpty(config.getMetadataStoreUrl()), "metadata store url must be provided");
+ checkArgument(!isEmpty(config.getConfigurationMetadataStoreUrl()),
+ "configuration metadata store url must be provided");
Review comment:
```suggestion
"configurationMetadataStoreUrl must be provided");
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org