This is an automated email from the ASF dual-hosted git repository.
sijie 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 10a1d4b initialize the offloader manager when starting the Pulsar
service (#8739)
10a1d4b is described below
commit 10a1d4bc1af1bef56264ed77f75443d5ea8d8202
Author: ran <[email protected]>
AuthorDate: Mon Nov 30 11:40:50 2020 +0800
initialize the offloader manager when starting the Pulsar service (#8739)
Motivation
Currently, the offload manager will be initialized when creating the ledger
offloader, it will be initialized many times, one time is enough.
Modifications
Initialize the offloader manager when starting the Pulsar service.
---
.../src/main/java/org/apache/pulsar/broker/PulsarService.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
index bc73f6a..61c1cea 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
@@ -472,6 +472,8 @@ public class PulsarService implements AutoCloseable {
schemaRegistryService = SchemaRegistryService.create(
schemaStorage,
config.getSchemaRegistryCompatibilityCheckers());
+ this.offloaderManager = OffloaderUtils.searchForOffloaders(
+ config.getOffloadersDirectory(),
config.getNarExtractionDirectory());
this.defaultOffloader = createManagedLedgerOffloader(
OffloadPolicies.create(this.getConfiguration().getProperties()));
this.brokerInterceptor = BrokerInterceptors.load(config);
@@ -913,7 +915,6 @@ public class PulsarService implements AutoCloseable {
checkNotNull(offloadPolicies.getOffloadersDirectory(),
"Offloader driver is configured to be '%s' but no
offloaders directory is configured.",
offloadPolicies.getManagedLedgerOffloadDriver());
- this.offloaderManager =
OffloaderUtils.searchForOffloaders(offloadPolicies.getOffloadersDirectory(),
config.getNarExtractionDirectory());
LedgerOffloaderFactory offloaderFactory =
this.offloaderManager.getOffloaderFactory(
offloadPolicies.getManagedLedgerOffloadDriver());
try {