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 2021/09/17 21:32:03 UTC

[GitHub] [pulsar] merlimat commented on a change in pull request #12078: [PIP-45] Removed ConfigurationCacheService

merlimat commented on a change in pull request #12078:
URL: https://github.com/apache/pulsar/pull/12078#discussion_r711362159



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/DispatchRateLimiter.java
##########
@@ -324,18 +320,12 @@ public DispatchRate getPoliciesDispatchRate(BrokerService brokerService) {
 
     public static Optional<Policies> getPolicies(BrokerService brokerService, String topicName) {
         final NamespaceName namespace = TopicName.get(topicName).getNamespaceObject();
-        final String path = path(POLICIES, namespace.toString());
-        Optional<Policies> policies = Optional.empty();
         try {
-            ConfigurationCacheService configurationCacheService = brokerService.pulsar().getConfigurationCache();
-            if (configurationCacheService != null) {
-                policies = configurationCacheService.policiesCache().getAsync(path)
-                        .get(brokerService.pulsar().getConfiguration().getZooKeeperOperationTimeoutSeconds(), SECONDS);
-            }
+            return brokerService.pulsar().getPulsarResources().getNamespaceResources().getPolicies(namespace);
         } catch (Exception e) {
             log.warn("Failed to get message-rate for {} ", topicName, e);
+            return Optional.empty();

Review comment:
       I know it's bad but I didn't want to get sidetracked since it's already a big PR :) 




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org