Avoid warning logs on topic policies not present
@@ -82,10 +82,12 @@ public class BacklogQuotaManager {
}
try {
+ if (pulsar.getTopicPoliciesService().cacheIsInitialized(topicName)) {
return Optional.ofNullable(pulsar.getTopicPoliciesService().getTopicPolicies(topicName))
.map(TopicPolicies::getBackLogQuotaMap)
.map(map -> map.get(BacklogQuotaType.destination_storage.name()))
.orElseGet(() -> getBacklogQuota(topicName.getNamespace(), policyPath));
+ }
} catch (Exception e) {
log.warn("Failed to read topic policies data, will apply the namespace backlog quota: topicName={}",
topicName, e);
