BewareMyPower commented on code in PR #19153:
URL: https://github.com/apache/pulsar/pull/19153#discussion_r1089581545


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -1033,17 +1047,36 @@ public CompletableFuture<Optional<Topic>> 
getTopic(final TopicName topicName, bo
                 });
             } else {
             return topics.computeIfAbsent(topicName.toString(), (name) -> {
+                topicEventsDispatcher.notify(topicName.toString(), 
TopicEvent.LOAD, EventStage.BEFORE);

Review Comment:
   It looks like the previous `return` does not apply the correct indent. You 
can apply the following diff to make it correct:
   
   ```diff
   diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
 b/pulsar-broker/src/main/ja
   va/org/apache/pulsar/broker/service/BrokerService.java
   index bd4cd9067f..28144381ab 100644
   --- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
   +++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
   @@ -1048,8 +1048,8 @@ public class BrokerService implements Closeable {
                        return loadOrCreatePersistentTopic(tpName, 
createIfMissing, properties);
                    });
                } else {
   -            return topics.computeIfAbsent(topicName.toString(), (name) -> {
   -                topicEventsDispatcher.notify(topicName.toString(), 
TopicEvent.LOAD, EventStage.BEFORE);
   +                return topics.computeIfAbsent(topicName.toString(), (name) 
-> {
   +                    topicEventsDispatcher.notify(topicName.toString(), 
TopicEvent.LOAD, EventStage.BEFORE);
                        if (topicName.isPartitioned()) {
                            final TopicName partitionedTopicName = 
TopicName.get(topicName.getPartitionedTopicName());
                            return 
this.fetchPartitionedTopicMetadataAsync(partitionedTopicName).thenCompose((metadata)
 ->
   {
   @@ -1081,7 +1081,7 @@ public class BrokerService implements Closeable {
                            topicEventsDispatcher.notify(topicName.toString(), 
TopicEvent.LOAD, EventStage.FAILURE);
                            return 
CompletableFuture.completedFuture(Optional.empty());
                        }
   -                    });
   +                });
                }
            } catch (IllegalArgumentException e) {
                log.warn("[{}] Illegalargument exception when loading topic", 
topicName, e);
   ```



-- 
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]

Reply via email to