mattisonchao commented on code in PR #22528:
URL: https://github.com/apache/pulsar/pull/22528#discussion_r1569952896
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java:
##########
@@ -70,7 +72,19 @@ public class SystemTopicBasedTopicPoliciesService implements
TopicPoliciesServic
private final PulsarService pulsarService;
private final HashSet localCluster;
private final String clusterName;
- private volatile NamespaceEventsSystemTopicFactory
namespaceEventsSystemTopicFactory;
+
+ private final ConcurrentInitializer<NamespaceEventsSystemTopicFactory>
+ namespaceEventsSystemTopicFactoryLazyInitializer = new
LazyInitializer<>() {
+ @Override
+ protected NamespaceEventsSystemTopicFactory initialize() {
+ try {
+ return new
NamespaceEventsSystemTopicFactory(pulsarService.getClient());
+ } catch (PulsarServerException e) {
+ log.error("Create namespace event system topic factory
error.", e);
+ throw new RuntimeException(e);
Review Comment:
Is it possible to avoid throwing a Runtime Exception directly? :/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]