Skip to content

Commit

Permalink
fix check replicator error
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode committed Aug 31, 2022
1 parent fc0ec3b commit 3d8b03e
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriBuilder;
import org.apache.bookkeeper.mledger.LedgerOffloader;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang.mutable.MutableObject;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -267,8 +268,13 @@ protected void internalDeleteNamespace(AsyncResponse asyncResponse, boolean auth
Set<String> partitionedTopicNames = new HashSet<>();
Set<String> topicNames = new HashSet<>();
try {
partitionedTopicNames.addAll(pulsar().getNamespaceService().getFullListOfTopics(namespaceName)
.get(config().getMetadataStoreOperationTimeoutSeconds(), TimeUnit.SECONDS));
if (policies == null || CollectionUtils.isEmpty(policies.replication_clusters)){
partitionedTopicNames.addAll(pulsar().getNamespaceService().getListOfPersistentTopics(namespaceName)
.get(config().getMetadataStoreOperationTimeoutSeconds(), TimeUnit.SECONDS));
} else {
partitionedTopicNames.addAll(pulsar().getNamespaceService().getFullListOfTopics(namespaceName)
.get(config().getMetadataStoreOperationTimeoutSeconds(), TimeUnit.SECONDS));
}
topicNames.addAll(getPartitionedTopicList(TopicDomain.persistent));
topicNames.addAll(getPartitionedTopicList(TopicDomain.non_persistent));
isEmpty = partitionedTopicNames.isEmpty() && topicNames.isEmpty();
Expand Down

0 comments on commit 3d8b03e

Please sign in to comment.