You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2020/12/02 09:23:44 UTC
[pulsar] branch branch-2.7 updated: initialize the offloader
manager when starting the Pulsar service (#8739) (#8742)
This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-2.7 by this push:
new 63a0723 initialize the offloader manager when starting the Pulsar service (#8739) (#8742)
63a0723 is described below
commit 63a0723e85e34fdf6bda7b6e2bcdd7f99fd1d85d
Author: lipenghui <pe...@apache.org>
AuthorDate: Wed Dec 2 17:23:28 2020 +0800
initialize the offloader manager when starting the Pulsar service (#8739) (#8742)
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)
Co-authored-by: ran <ga...@126.com>
---
.../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 {