Skip to content

Commit

Permalink
Revert useless changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattisonchao committed Nov 13, 2023
1 parent 21ce70d commit 707c761
Showing 1 changed file with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1460,23 +1460,7 @@ private void checkOwnershipAndCreatePersistentTopic(final String topic, boolean
pulsar.getNamespaceService().isServiceUnitActiveAsync(topicName)
.thenAccept(isActive -> {
if (isActive) {
CompletableFuture<Map<String, String>> propertiesFuture;
if (properties == null) {
//Read properties from storage when loading topic.
propertiesFuture = fetchTopicPropertiesAsync(topicName);
} else {
propertiesFuture = CompletableFuture.completedFuture(properties);
}
propertiesFuture.thenAccept(finalProperties ->
//TODO add topicName in properties?
createPersistentTopic(topic, createIfMissing, topicFuture,
finalProperties, topicPolicies)
).exceptionally(throwable -> {
log.warn("[{}] Read topic property failed", topic, throwable);
pulsar.getExecutor().execute(() -> topics.remove(topic, topicFuture));
topicFuture.completeExceptionally(throwable);
return null;
});
createPersistentTopic(topic, createIfMissing, topicFuture, properties, topicPolicies);
} else {
// namespace is being unloaded
String msg = String.format("Namespace is being unloaded, cannot add topic %s", topic);
Expand Down

0 comments on commit 707c761

Please sign in to comment.