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 2020/08/23 04:00:44 UTC

[GitHub] [pulsar] hangc0276 commented on a change in pull request #7863: support message dispatch rate on topic level

hangc0276 commented on a change in pull request #7863:
URL: https://github.com/apache/pulsar/pull/7863#discussion_r475166741



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java
##########
@@ -329,5 +337,15 @@ Boolean getPoliciesCacheInit(NamespaceName namespaceName) {
         return policyCacheInitMap.get(namespaceName);
     }
 
+    @Override
+    public void registerListener(TopicName topicName, TopicPolicyListener<TopicPolicies> listener) {
+        listeners.computeIfAbsent(topicName, k -> Lists.newCopyOnWriteArrayList()).add(listener);
+    }
+
+    @Override
+    public void unregisterListener(TopicName topicName, TopicPolicyListener<TopicPolicies> listener) {
+        listeners.computeIfAbsent(topicName, k -> Lists.newCopyOnWriteArrayList());

Review comment:
       It should remove the specific listener,  and i have updated the code, please take a look again. Thanks




----------------------------------------------------------------
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:
users@infra.apache.org