merlimat commented on a change in pull request #2025: Allow non-pesistent
topics to be retrieved along with persistent ones from the
"GetTopicsOfNamespace" method
URL: https://github.com/apache/incubator-pulsar/pull/2025#discussion_r197881621
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
##########
@@ -825,6 +827,20 @@ public ServiceUnitId getServiceUnitId(TopicName
topicName) throws Exception {
// NoNode means there are no persistent topics for this namespace
}
+ // Non-persistent topics don't have managed ledges so we have to
retrieve them from local cache.
+ synchronized
(pulsar.getBrokerService().getMultiLayerTopicMap()) {
Review comment:
This will only answer with the non-persistent topics served by the broker
that it's handling the particular request. However, topics for a single
namespace can be spread across multiple brokers.
We would need to do something like this (
https://github.com/apache/incubator-pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java#L170
) to get the correct list of non-persistent topics.
I think the best option is to actually use the same API to get the list of
non-persistent topics through HTTP. `GET
/admin/v2/non-persistent/{tenant}/{namespace}`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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