You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/06/25 17:41:55 UTC
[GitHub] merlimat commented on a change in pull request #2025: Allow
non-pesistent topics to be retrieved along with persistent ones from the
"GetTopicsOfNamespace" method
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:
users@infra.apache.org
With regards,
Apache Git Services