Technoboy- commented on code in PR #19171:
URL: https://github.com/apache/pulsar/pull/19171#discussion_r1067638201


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:
##########
@@ -1165,11 +1165,16 @@ public CompletableFuture<List<String>> 
getOwnedTopicListForNamespaceBundle(Names
     public CompletableFuture<Boolean> checkTopicExists(TopicName topic) {
         if (topic.isPersistent()) {
             if (topic.isPartitioned()) {
-                return 
pulsar.getPulsarResources().getNamespaceResources().getPartitionedTopicResources()
-                        
.partitionedTopicExistsAsync(TopicName.get(topic.getPartitionedTopicName()))
-                        .thenCompose(exists -> exists
-                                ? 
pulsar.getPulsarResources().getTopicResources().persistentTopicExists(topic)
-                                : CompletableFuture.completedFuture(false));
+                return pulsar.getBrokerService()
+                        
.fetchPartitionedTopicMetadataAsync(TopicName.get(topic.getPartitionedTopicName()))
+                        .thenCompose(metadata -> {
+                            // Allow crate non-partitioned persistent topic 
that name includes `-partition-`

Review Comment:
   crate -> `create`



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:
##########
@@ -1165,11 +1165,16 @@ public CompletableFuture<List<String>> 
getOwnedTopicListForNamespaceBundle(Names
     public CompletableFuture<Boolean> checkTopicExists(TopicName topic) {
         if (topic.isPersistent()) {
             if (topic.isPartitioned()) {
-                return 
pulsar.getPulsarResources().getNamespaceResources().getPartitionedTopicResources()
-                        
.partitionedTopicExistsAsync(TopicName.get(topic.getPartitionedTopicName()))
-                        .thenCompose(exists -> exists
-                                ? 
pulsar.getPulsarResources().getTopicResources().persistentTopicExists(topic)
-                                : CompletableFuture.completedFuture(false));
+                return pulsar.getBrokerService()
+                        
.fetchPartitionedTopicMetadataAsync(TopicName.get(topic.getPartitionedTopicName()))
+                        .thenCompose(metadata -> {
+                            // Allow crate non-partitioned persistent topic 
that name includes `-partition-`

Review Comment:
   crate -> `creating`



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