This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-2.6 by this push:
new f7da1d5 initialize the offloader manager when starting the Pulsar
service (#8739)
f7da1d5 is described below
commit f7da1d5bab7b7a01239f0aad085bc92b385f36e7
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.
(cherry picked from commit 10a1d4bc1af1bef56264ed77f75443d5ea8d8202)
---
.../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 a18d792..6b2e48a 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
@@ -458,6 +458,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);
@@ -892,7 +894,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 {