sijie commented on a change in pull request #6187: [Issue 5904]Support `unload`
all partitions of a partitioned topic
URL: https://github.com/apache/pulsar/pull/6187#discussion_r376158749
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -552,6 +552,36 @@ protected ZooKeeperChildrenCache failureDomainListCache()
{
return pulsar().getConfigurationCache().failureDomainListCache();
}
+ protected CompletableFuture<PartitionedTopicMetadata>
getPartitionedTopicMetadataAsync(
+ TopicName topicName, boolean authoritative, boolean
checkAllowAutoCreation) {
+ validateClusterOwnership(topicName.getCluster());
+ // validates global-namespace contains local/peer cluster: if
peer/local cluster present then lookup can
+ // serve/redirect request else fail partitioned-metadata-request so,
client fails while creating
+ // producer/consumer
+ validateGlobalNamespaceOwnership(topicName.getNamespaceObject());
+
+ CompletableFuture<PartitionedTopicMetadata> future = new
CompletableFuture<>();
+
+ try {
+ checkConnect(topicName);
+ } catch (WebApplicationException e) {
+ validateAdminAccessForTenant(topicName.getTenant());
+ } catch (Exception e) {
+ // unknown error marked as internal server error
+ log.warn("Unexpected error while authorizing lookup. topic={},
role={}. Error: {}", topicName,
+ clientAppId(), e.getMessage(), e);
+ future.completeExceptionally(e);
Review comment:
Don't we need to return here?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services