This is an automated email from the ASF dual-hosted git repository.
penghui 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 4dd4ba5ed6d [improve][broker] Use shared broker client scheduled
executor provider (#16338)
4dd4ba5ed6d is described below
commit 4dd4ba5ed6de06eb22431c74863cc9a878d8a791
Author: lipenghui <[email protected]>
AuthorDate: Mon Jul 4 09:32:23 2022 +0800
[improve][broker] Use shared broker client scheduled executor provider
(#16338)
---
.../src/main/java/org/apache/pulsar/broker/PulsarService.java | 6 ++++++
1 file changed, 6 insertions(+)
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 afa599411bc..f85afe0cc72 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
@@ -132,6 +132,7 @@ import
org.apache.pulsar.client.impl.conf.ClientConfigurationData;
import org.apache.pulsar.client.impl.conf.ConfigurationDataUtils;
import org.apache.pulsar.client.internal.PropertiesUtils;
import org.apache.pulsar.client.util.ExecutorProvider;
+import org.apache.pulsar.client.util.ScheduledExecutorProvider;
import org.apache.pulsar.common.conf.InternalConfigurationData;
import org.apache.pulsar.common.configuration.PulsarConfigurationLoader;
import org.apache.pulsar.common.configuration.VipStatus;
@@ -236,6 +237,7 @@ public class PulsarService implements AutoCloseable,
ShutdownService {
protected final EventLoopGroup ioEventLoopGroup;
private final ExecutorProvider brokerClientSharedInternalExecutorProvider;
private final ExecutorProvider brokerClientSharedExternalExecutorProvider;
+ private final ScheduledExecutorProvider
brokerClientSharedScheduledExecutorProvider;
private final Timer brokerClientSharedTimer;
private MetricsGenerator metricsGenerator;
@@ -337,6 +339,8 @@ public class PulsarService implements AutoCloseable,
ShutdownService {
// since an instance is required, a single threaded shared instance is
used for all broker client instances
this.brokerClientSharedExternalExecutorProvider =
new ExecutorProvider(1,
"broker-client-shared-external-executor");
+ this.brokerClientSharedScheduledExecutorProvider =
+ new ScheduledExecutorProvider(1,
"broker-client-shared-scheduled-executor");
this.brokerClientSharedTimer =
new HashedWheelTimer(new
DefaultThreadFactory("broker-client-shared-timer"), 1, TimeUnit.MILLISECONDS);
@@ -543,6 +547,7 @@ public class PulsarService implements AutoCloseable,
ShutdownService {
brokerClientSharedExternalExecutorProvider.shutdownNow();
brokerClientSharedInternalExecutorProvider.shutdownNow();
+ brokerClientSharedScheduledExecutorProvider.shutdownNow();
brokerClientSharedTimer.stop();
ioEventLoopGroup.shutdownGracefully();
@@ -1398,6 +1403,7 @@ public class PulsarService implements AutoCloseable,
ShutdownService {
.timer(brokerClientSharedTimer)
.internalExecutorProvider(brokerClientSharedInternalExecutorProvider)
.externalExecutorProvider(brokerClientSharedExternalExecutorProvider)
+
.scheduledExecutorProvider(brokerClientSharedScheduledExecutorProvider)
.build();
}