suiyuzeng opened a new issue #11079:
URL: https://github.com/apache/pulsar/issues/11079


   **Is your enhancement request related to a problem? Please describe.**
      The count of topic created in 1 second is less than 200, when the topic 
count of the namespace is about 200,000.
   
   **Describe the solution you'd like**
      Increase the rate of topic creation.
   
   **Describe alternatives you've considered**
      The reason is that the time cost of topic exist checking is too long when 
the topic count is large.
       protected CompletableFuture<Boolean> checkTopicExistsAsync(TopicName 
topicName) {
           return 
pulsar().getNamespaceService().getListOfTopics(topicName.getNamespaceObject(),
                   CommandGetTopicsOfNamespace.Mode.ALL)
                   .thenCompose(topics -> {
                       boolean exists = false;
                       for (String topic : topics) {
                           if (topicName.getPartitionedTopicName().equals(
                                   
TopicName.get(topic).getPartitionedTopicName())) {
                               exists = true;
                               break;
                           }
                       }
                       return CompletableFuture.completedFuture(exists);
                   });
       } 
   
      Can we use 
org.apache.pulsar.broker.namespace.NamespaceService#checkTopicExists  to check 
if the topic is exits?
   
   **Additional context**
   None
   


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to