This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 9dbee16  [Broker] Allow configuring configurationMetadataStore when 
initialize cluster metadata (#13889)
9dbee16 is described below

commit 9dbee16b1f6026a40408b32d78a580a500212a4a
Author: Zike Yang <[email protected]>
AuthorDate: Sat Jan 22 22:01:38 2022 +0800

    [Broker] Allow configuring configurationMetadataStore when initialize 
cluster metadata (#13889)
    
    Motivation
    As per #13077, `configurationStoreServers` need to be renamed to 
`configurationMetadataStoreUrl`.
    
    Modification
    * Add `configurationMetadataStore` to PulsarClusterMetadataSetup.
    
    Signed-off-by: Zike Yang <[email protected]>
---
 .../apache/pulsar/PulsarClusterMetadataSetup.java  | 35 ++++++++++++++--------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java 
b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java
index 52d7e0d..35d7ef7 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java
@@ -102,10 +102,15 @@ public class PulsarClusterMetadataSetup {
                 description = "Global ZooKeeper quorum connection string", 
required = false, hidden = true)
         private String globalZookeeper;
 
-        @Parameter(names = { "-cs",
-            "--configuration-store" }, description = "Configuration Store 
connection string", required = true)
+        @Parameter(names = {"-cs",
+                "--configuration-store"}, description = "Configuration Store 
connection string", hidden = true)
         private String configurationStore;
 
+        @Parameter(names = {"-cms",
+                "--configuration-metadata-store"}, description = 
"Configuration Metadata Store connection string",
+                hidden = false)
+        private String configurationMetadataStore;
+
         @Parameter(names = {
             "--initial-num-stream-storage-containers"
         }, description = "Num storage containers of BookKeeper stream storage")
@@ -194,21 +199,25 @@ public class PulsarClusterMetadataSetup {
             System.exit(1);
         }
 
-        if (arguments.configurationStore == null && arguments.globalZookeeper 
== null) {
-            System.err.println("Configuration store address argument is 
required (--configuration-store)");
+        if (arguments.configurationMetadataStore == null && 
arguments.configurationStore == null
+                && arguments.globalZookeeper == null) {
+            System.err.println(
+                    "Configuration metadata store address argument is required 
(--configuration-metadata-store)");
             jcommander.usage();
             System.exit(1);
         }
 
-        if (arguments.configurationStore != null && arguments.globalZookeeper 
!= null) {
-            System.err.println("Configuration store argument 
(--configuration-store) "
-                    + "supersedes the deprecated (--global-zookeeper) 
argument");
+        if (arguments.configurationMetadataStore != null && 
(arguments.configurationStore != null
+                || arguments.globalZookeeper != null)) {
+            System.err.println("Configuration metadata store argument 
(--configuration-metadata-store) "
+                    + "supersedes the deprecated (--global-zookeeper and 
--configuration-store) argument");
             jcommander.usage();
             System.exit(1);
         }
 
-        if (arguments.configurationStore == null) {
-            arguments.configurationStore = arguments.globalZookeeper;
+        if (arguments.configurationMetadataStore == null) {
+            arguments.configurationMetadataStore = 
arguments.configurationStore == null ? arguments.globalZookeeper :
+                    arguments.configurationStore;
         }
 
         if (arguments.metadataStoreUrl == null) {
@@ -220,12 +229,12 @@ public class PulsarClusterMetadataSetup {
             System.exit(1);
         }
 
-        log.info("Setting up cluster {} with metadata-store={} 
configuration-store={}", arguments.cluster,
-                arguments.metadataStoreUrl, arguments.configurationStore);
+        log.info("Setting up cluster {} with metadata-store={} 
configuration-metadata-store={}", arguments.cluster,
+                arguments.metadataStoreUrl, 
arguments.configurationMetadataStore);
 
         MetadataStoreExtended localStore =
                 initMetadataStore(arguments.metadataStoreUrl, 
arguments.zkSessionTimeoutMillis);
-        MetadataStoreExtended configStore = 
initMetadataStore(arguments.configurationStore,
+        MetadataStoreExtended configStore = 
initMetadataStore(arguments.configurationMetadataStore,
                 arguments.zkSessionTimeoutMillis);
 
         // Format BookKeeper ledger storage metadata
@@ -251,7 +260,7 @@ public class PulsarClusterMetadataSetup {
             ServiceURI bkMetadataServiceUri = ServiceURI.create(uriStr);
 
             // initial distributed log metadata
-            initialDlogNamespaceMetadata(arguments.configurationStore, uriStr);
+            initialDlogNamespaceMetadata(arguments.configurationMetadataStore, 
uriStr);
 
             // Format BookKeeper stream storage metadata
             if (arguments.numStreamStorageContainers > 0) {

Reply via email to