Skip to content

Commit

Permalink
fix test error
Browse files Browse the repository at this point in the history
  • Loading branch information
gavingaozhangmin committed Aug 24, 2022
1 parent 7c0519f commit c101b63
Showing 1 changed file with 11 additions and 6 deletions.
Expand Up @@ -310,7 +310,8 @@ protected CompletableFuture<Void> internalDeleteNamespaceAsync() {
.getNamespaceBundleFactory()
.getBundles(namespaceName);
for (NamespaceBundle bundle : bundles.getBundles()) {
// check if the bundle is owned by any broker, if not then we do not need to delete the bundle
// check if the bundle is owned by any broker,
// if not then we do not need to delete the bundle
deleteBundleFutures.add(pulsar().getNamespaceService()
.getOwnerAsync(bundle).thenCompose(ownership -> {
if (ownership.isPresent()) {
Expand Down Expand Up @@ -429,11 +430,14 @@ protected CompletableFuture<Void> internalDeleteNamespaceForcefullyAsync() {
}
}
return future
.thenCompose(__ -> namespaceResources().setPoliciesAsync(namespaceName, old -> {
old.deleted = true;
return old;
}))
.thenCompose(__ -> pulsar().getNamespaceService().getFullListOfTopics(namespaceName)
.thenCompose(topics -> {
namespaceResources().setPoliciesAsync(namespaceName, old -> {
old.deleted = true;
return old;
});
return CompletableFuture.completedFuture(topics);
})
.thenCompose(topics -> {
final List<CompletableFuture<Void>> topicFutures = Lists.newArrayList();
if (!topics.isEmpty()) {
Expand Down Expand Up @@ -476,7 +480,8 @@ protected CompletableFuture<Void> internalDeleteNamespaceForcefullyAsync() {
NamespaceBundles bundles = pulsar().getNamespaceService()
.getNamespaceBundleFactory().getBundles(namespaceName);
for (NamespaceBundle bundle : bundles.getBundles()) {
// check if the bundle is owned by any broker, if not then we do not need to delete the bundle
// check if the bundle is owned by any broker,
// if not then we do not need to delete the bundle
deleteBundleFutures.add(pulsar().getNamespaceService().getOwnerAsync(bundle)
.thenCompose(ownership -> {
if (ownership.isPresent()) {
Expand Down

0 comments on commit c101b63

Please sign in to comment.