Skip to content

Commit

Permalink
[fix] The Pulsar standalone bookie is not getting passed the config f…
Browse files Browse the repository at this point in the history
…rom standalone.conf (apache#18126)
  • Loading branch information
merlimat authored Oct 20, 2022
1 parent b0945d1 commit cbf5cf5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,11 @@ private void startBookieWithMetadataStore() throws Exception {
} 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,20 @@ 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;
private int bkPort = 0;

private boolean clearOldData;

public BKClusterConf baseServerConfiguration(ServerConfiguration baseServerConfiguration) {
this.baseServerConfiguration = baseServerConfiguration;
return this;
}

public BKClusterConf metadataServiceUri(String metadataServiceUri) {
this.metadataServiceUri = metadataServiceUri;
return this;
Expand Down Expand Up @@ -115,7 +122,8 @@ public static BKClusterConf builder() {
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 =
Expand Down

0 comments on commit cbf5cf5

Please sign in to comment.