poorbarcode commented on code in PR #17338:
URL: https://github.com/apache/pulsar/pull/17338#discussion_r959640019
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:
##########
@@ -307,20 +314,33 @@ protected void internalDeleteNamespace(AsyncResponse
asyncResponse, boolean auth
}
// remove from owned namespace map and ephemeral node from ZK
- final List<CompletableFuture<Void>> futures = Lists.newArrayList();
+ final List<CompletableFuture<Void>> deletePartitionedTopicFuture =
Lists.newArrayList();
// remove system topics first.
- if (!topics.isEmpty()) {
- for (String topic : topics) {
+ if (!partitionedTopicNames.isEmpty()) {
+ for (String topic : partitionedTopicNames) {
try {
-
futures.add(pulsar().getAdminClient().topics().deleteAsync(topic, true, true));
Review Comment:
This is A good suggestion, but 'topicname.get(topic name).ispartitioned()'
just uses the naming rule to figure out if it's a `partitioned topic`, which
isn't exact. When enabled the feature `auto create topic`, users can create a
non-partitioned topic name with
`persistent://public/default/special-partition-0`
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:
##########
@@ -264,13 +264,14 @@ protected void internalDeleteNamespace(AsyncResponse
asyncResponse, boolean auth
}
boolean isEmpty;
- List<String> topics;
+ Set<String> partitionedTopicNames = new HashSet<>();
+ Set<String> topicNames = new HashSet<>();
try {
- topics =
pulsar().getNamespaceService().getListOfPersistentTopics(namespaceName)
- .get(config().getMetadataStoreOperationTimeoutSeconds(),
TimeUnit.SECONDS);
- topics.addAll(getPartitionedTopicList(TopicDomain.persistent));
- topics.addAll(getPartitionedTopicList(TopicDomain.non_persistent));
- isEmpty = topics.isEmpty();
+
partitionedTopicNames.addAll(pulsar().getNamespaceService().getListOfPersistentTopics(namespaceName)
Review Comment:
Already fixed
--
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]