Class SystemTopicBasedTopicPoliciesService

  • All Implemented Interfaces:
    TopicPoliciesService

    public class SystemTopicBasedTopicPoliciesService
    extends java.lang.Object
    implements TopicPoliciesService
    Cached topic policies service will cache the system topic reader and the topic policies While reader cache for the namespace was removed, the topic policies will remove automatically.
    • Constructor Detail

      • SystemTopicBasedTopicPoliciesService

        public SystemTopicBasedTopicPoliciesService​(PulsarService pulsarService)
    • Method Detail

      • deleteTopicPoliciesAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteTopicPoliciesAsync​(org.apache.pulsar.common.naming.TopicName topicName)
        Description copied from interface: TopicPoliciesService
        Delete policies for a topic async.
        Specified by:
        deleteTopicPoliciesAsync in interface TopicPoliciesService
        Parameters:
        topicName - topic name
      • updateTopicPoliciesAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> updateTopicPoliciesAsync​(org.apache.pulsar.common.naming.TopicName topicName,
                                                                                               org.apache.pulsar.common.policies.data.TopicPolicies policies)
        Description copied from interface: TopicPoliciesService
        Update policies for a topic async.
        Specified by:
        updateTopicPoliciesAsync in interface TopicPoliciesService
        Parameters:
        topicName - topic name
        policies - policies for the topic name
      • getTopicPoliciesIfExists

        public org.apache.pulsar.common.policies.data.TopicPolicies getTopicPoliciesIfExists​(org.apache.pulsar.common.naming.TopicName topicName)
        Description copied from interface: TopicPoliciesService
        Get policies from current cache.
        Specified by:
        getTopicPoliciesIfExists in interface TopicPoliciesService
        Parameters:
        topicName - topic name
        Returns:
        the topic policies
      • getTopicPoliciesBypassCacheAsync

        public java.util.concurrent.CompletableFuture<org.apache.pulsar.common.policies.data.TopicPolicies> getTopicPoliciesBypassCacheAsync​(org.apache.pulsar.common.naming.TopicName topicName)
        Description copied from interface: TopicPoliciesService
        Get policies for a topic without cache async.
        Specified by:
        getTopicPoliciesBypassCacheAsync in interface TopicPoliciesService
        Parameters:
        topicName - topic name
        Returns:
        future of the topic policies
      • createSystemTopicClientWithRetry

        protected java.util.concurrent.CompletableFuture<SystemTopicClient.Reader<org.apache.pulsar.common.events.PulsarEvent>> createSystemTopicClientWithRetry​(org.apache.pulsar.common.naming.NamespaceName namespace)
      • getPoliciesCacheInit

        public java.lang.Boolean getPoliciesCacheInit​(org.apache.pulsar.common.naming.NamespaceName namespaceName)
      • clean

        public void clean​(org.apache.pulsar.common.naming.TopicName topicName)
        Description copied from interface: TopicPoliciesService
        clean cache and listeners in TopicPolicies and so on.
        Specified by:
        clean in interface TopicPoliciesService
      • getPoliciesCache

        protected java.util.Map<org.apache.pulsar.common.naming.TopicName,​org.apache.pulsar.common.policies.data.TopicPolicies> getPoliciesCache()
      • getListeners

        protected java.util.Map<org.apache.pulsar.common.naming.TopicName,​java.util.List<TopicPolicyListener<org.apache.pulsar.common.policies.data.TopicPolicies>>> getListeners()