You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2022/10/20 04:29:43 UTC

[pulsar] branch branch-2.11 updated (ae4b8e2a8fc -> a0e53262db0)

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

mmerli pushed a change to branch branch-2.11
in repository https://gitbox.apache.org/repos/asf/pulsar.git


    from ae4b8e2a8fc [improve][ml] Reduce unnecessary calling `span()` when filtering read entries. (#18106)
     new f0290fe2f33 [Improve][Standalone] Standalone Add param of --metadata-url for runing with metadata (#17077)
     new a0e53262db0 [fix] The Pulsar standalone bookie is not getting passed the config from standalone.conf (#18126)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/apache/pulsar/PulsarStandalone.java | 19 +++++++++++++++----
 .../apache/pulsar/metadata/bookkeeper/BKCluster.java  | 10 +++++++++-
 2 files changed, 24 insertions(+), 5 deletions(-)


[pulsar] 02/02: [fix] The Pulsar standalone bookie is not getting passed the config from standalone.conf (#18126)

Posted by mm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a0e53262db02c983233b24994f2a79cb7367606f
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Wed Oct 19 21:22:16 2022 -0700

    [fix] The Pulsar standalone bookie is not getting passed the config from standalone.conf (#18126)
---
 .../src/main/java/org/apache/pulsar/PulsarStandalone.java      |  4 ++++
 .../java/org/apache/pulsar/metadata/bookkeeper/BKCluster.java  | 10 +++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
index 219a1ddf2ea..1191b98f8c6 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
@@ -445,7 +445,11 @@ public class PulsarStandalone implements AutoCloseable {
         } else {
             log.info("Starting BK with metadata store:", metadataStoreUrl);
         }
+
+        ServerConfiguration bkServerConf = new ServerConfiguration();
+        bkServerConf.loadConf(new File(configFile).toURI().toURL());
         bkCluster = BKCluster.builder()
+                .baseServerConfiguration(bkServerConf)
                 .metadataServiceUri(metadataStoreUrl)
                 .bkPort(bkPort)
                 .numBookies(numOfBk)
diff --git a/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/BKCluster.java b/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/BKCluster.java
index d7be00ab259..53825cae2b2 100644
--- a/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/BKCluster.java
+++ b/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/BKCluster.java
@@ -71,6 +71,8 @@ public class BKCluster implements AutoCloseable {
     protected final ClientConfiguration baseClientConf;
 
     public static class BKClusterConf {
+
+        private ServerConfiguration baseServerConfiguration;
         private String metadataServiceUri;
         private int numBookies = 1;
         private String dataDir;
@@ -78,6 +80,11 @@ public class BKCluster implements AutoCloseable {
 
         private boolean clearOldData;
 
+        public BKClusterConf baseServerConfiguration(ServerConfiguration baseServerConfiguration) {
+            this.baseServerConfiguration = baseServerConfiguration;
+            return this;
+        }
+
         public BKClusterConf metadataServiceUri(String metadataServiceUri) {
             this.metadataServiceUri = metadataServiceUri;
             return this;
@@ -115,7 +122,8 @@ public class BKCluster implements AutoCloseable {
     private BKCluster(BKClusterConf bkClusterConf) throws Exception {
         this.clusterConf = bkClusterConf;
 
-        this.baseConf = newBaseServerConfiguration();
+        this.baseConf = bkClusterConf.baseServerConfiguration != null
+                ? bkClusterConf.baseServerConfiguration : newBaseServerConfiguration();
         this.baseClientConf = newBaseClientConfiguration();
 
         this.store =


[pulsar] 01/02: [Improve][Standalone] Standalone Add param of --metadata-url for runing with metadata (#17077)

Posted by mm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f0290fe2f33dc1e8ddf53b0bd7cc5e6dda0510f3
Author: Lan <gc...@gmail.com>
AuthorDate: Mon Sep 26 17:44:35 2022 +0800

    [Improve][Standalone] Standalone Add param of --metadata-url for runing with metadata (#17077)
---
 .../main/java/org/apache/pulsar/PulsarStandalone.java   | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
index 8866922e103..219a1ddf2ea 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
@@ -223,6 +223,10 @@ public class PulsarStandalone implements AutoCloseable {
             description = "Directory for storing metadata")
     private String metadataDir = "data/metadata";
 
+    @Parameter(names = { "--metadata-url" },
+            description = "Metadata store url")
+    private String metadataStoreUrl = "";
+
     @Parameter(names = {"--zookeeper-port"}, description = "Local zookeeper's port",
             hidden = true)
     private int zkPort = 2181;
@@ -290,7 +294,7 @@ public class PulsarStandalone implements AutoCloseable {
 
         if (!this.isOnlyBroker()) {
             if (usingNewDefaultsPIP117) {
-                startBookieWithRocksDB();
+                startBookieWithMetadataStore();
             } else {
                 startBookieWithZookeeper();
             }
@@ -434,10 +438,13 @@ public class PulsarStandalone implements AutoCloseable {
         }
     }
 
-
-    private void startBookieWithRocksDB() throws Exception {
-        log.info("Starting BK with RocksDb metadata store");
-        String metadataStoreUrl = "rocksdb://" + Paths.get(metadataDir).toAbsolutePath();
+    private void startBookieWithMetadataStore() throws Exception {
+        if (StringUtils.isBlank(metadataStoreUrl)){
+            log.info("Starting BK with RocksDb metadata store");
+            metadataStoreUrl = "rocksdb://" + Paths.get(metadataDir).toAbsolutePath();
+        } else {
+            log.info("Starting BK with metadata store:", metadataStoreUrl);
+        }
         bkCluster = BKCluster.builder()
                 .metadataServiceUri(metadataStoreUrl)
                 .bkPort(bkPort)