Interface Namespaces


public interface Namespaces
Admin interface for namespaces management.
  • Method Details

    • getNamespaces

      List<String> getNamespaces(String tenant) throws PulsarAdminException
      Get the list of namespaces.

      Get the list of all the namespaces for a certain tenant.

      Response Example:

       ["my-tenant/c1/namespace1",
        "my-tenant/global/namespace2",
        "my-tenant/c2/namespace3"]
       
      Parameters:
      tenant - Tenant name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Tenant does not exist
      PulsarAdminException - Unexpected error
    • getNamespacesAsync

      CompletableFuture<List<String>> getNamespacesAsync(String tenant)
      Get the list of namespaces asynchronously.

      Get the list of all the namespaces for a certain tenant.

      Response Example:

       ["my-tenant/c1/namespace1",
        "my-tenant/global/namespace2",
        "my-tenant/c2/namespace3"]
       
      Parameters:
      tenant - Tenant name
    • getNamespaces

      @Deprecated List<String> getNamespaces(String tenant, String cluster) throws PulsarAdminException
      Deprecated.
      Get the list of namespaces.

      Get the list of all the namespaces for a certain tenant on single cluster.

      Response Example:

       ["my-tenant/use/namespace1", "my-tenant/use/namespace2"]
       
      Parameters:
      tenant - Tenant name
      cluster - Cluster name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Tenant or cluster does not exist
      PulsarAdminException - Unexpected error
    • getTopics

      List<String> getTopics(String namespace) throws PulsarAdminException
      Get the list of topics.

      Get the list of all the topics under a certain namespace.

      Response Example:

       ["persistent://my-tenant/use/namespace1/my-topic-1",
        "persistent://my-tenant/use/namespace1/my-topic-2"]
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getTopicsAsync

      CompletableFuture<List<String>> getTopicsAsync(String namespace)
      Get the list of topics asynchronously.

      Get the list of all the topics under a certain namespace.

      Response Example:

       ["persistent://my-tenant/use/namespace1/my-topic-1",
        "persistent://my-tenant/use/namespace1/my-topic-2"]
       
      Parameters:
      namespace - Namespace name
    • getTopics

      List<String> getTopics(String namespace, ListNamespaceTopicsOptions options) throws PulsarAdminException
      Get the list of topics.

      Get the list of all the topics under a certain namespace.

      Response Example:

       ["persistent://my-tenant/use/namespace1/my-topic-1",
        "persistent://my-tenant/use/namespace1/my-topic-2"]
       
      Parameters:
      namespace - Namespace name
      options - List namespace topics options
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getTopicsAsync

      CompletableFuture<List<String>> getTopicsAsync(String namespace, ListNamespaceTopicsOptions options)
      Get the list of topics asynchronously.

      Get the list of all the topics under a certain namespace.

      Response Example:

       ["persistent://my-tenant/use/namespace1/my-topic-1",
        "persistent://my-tenant/use/namespace1/my-topic-2"]
       
      Parameters:
      namespace - Namespace name
      options - List namespace topics options
    • getBundles

      BundlesData getBundles(String namespace) throws PulsarAdminException
      Get the list of bundles.

      Get the list of all the bundles under a certain namespace.

      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getBundlesAsync

      CompletableFuture<BundlesData> getBundlesAsync(String namespace)
      Get the list of bundles asynchronously.

      Get the list of all the bundles under a certain namespace.

      Parameters:
      namespace - Namespace name
    • getPolicies

      Policies getPolicies(String namespace) throws PulsarAdminException
      Get policies for a namespace.

      Get the dump all the policies specified for a namespace.

      Response example:

       {
         "auth_policies" : {
           "namespace_auth" : {
             "my-role" : [ "produce" ]
           },
           "destination_auth" : {
             "persistent://prop/local/ns1/my-topic" : {
               "role-1" : [ "produce" ],
               "role-2" : [ "consume" ]
             }
           }
         },
         "replication_clusters" : ["use", "usw"],
         "message_ttl_in_seconds" : 300
       }
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
      See Also:
    • getPoliciesAsync

      CompletableFuture<Policies> getPoliciesAsync(String namespace)
      Get policies for a namespace asynchronously.

      Get the dump all the policies specified for a namespace.

      Response example:

       {
         "auth_policies" : {
           "namespace_auth" : {
             "my-role" : [ "produce" ]
           },
           "destination_auth" : {
             "persistent://prop/local/ns1/my-topic" : {
               "role-1" : [ "produce" ],
               "role-2" : [ "consume" ]
             }
           }
         },
         "replication_clusters" : ["use", "usw"],
         "message_ttl_in_seconds" : 300
       }
       
      Parameters:
      namespace - Namespace name
      See Also:
    • createNamespace

      void createNamespace(String namespace, int numBundles) throws PulsarAdminException
      Create a new namespace.

      Creates a new empty namespace with no policies attached.

      Parameters:
      namespace - Namespace name
      numBundles - Number of bundles
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Tenant or cluster does not exist
      PulsarAdminException.ConflictException - Namespace already exists
      PulsarAdminException - Unexpected error
    • createNamespaceAsync

      CompletableFuture<Void> createNamespaceAsync(String namespace, int numBundles)
      Create a new namespace.

      Creates a new empty namespace with no policies attached.

      Parameters:
      namespace - Namespace name
      numBundles - Number of bundles
    • createNamespace

      void createNamespace(String namespace, BundlesData bundlesData) throws PulsarAdminException
      Create a new namespace.

      Creates a new empty namespace with no policies attached.

      Parameters:
      namespace - Namespace name
      bundlesData - Bundles Data
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Tenant or cluster does not exist
      PulsarAdminException.ConflictException - Namespace already exists
      PulsarAdminException - Unexpected error
    • createNamespaceAsync

      CompletableFuture<Void> createNamespaceAsync(String namespace, BundlesData bundlesData)
      Create a new namespace asynchronously.

      Creates a new empty namespace with no policies attached.

      Parameters:
      namespace - Namespace name
      bundlesData - Bundles Data
    • createNamespace

      void createNamespace(String namespace) throws PulsarAdminException
      Create a new namespace.

      Creates a new empty namespace with no policies attached.

      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Tenant or cluster does not exist
      PulsarAdminException.ConflictException - Namespace already exists
      PulsarAdminException - Unexpected error
    • createNamespaceAsync

      CompletableFuture<Void> createNamespaceAsync(String namespace)
      Create a new namespace asynchronously.

      Creates a new empty namespace with no policies attached.

      Parameters:
      namespace - Namespace name
    • createNamespace

      void createNamespace(String namespace, Set<String> clusters) throws PulsarAdminException
      Create a new namespace.

      Creates a new empty namespace with no policies attached.

      Parameters:
      namespace - Namespace name
      clusters - Clusters in which the namespace will be present. If more than one cluster is present, replication across clusters will be enabled.
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Tenant or cluster does not exist
      PulsarAdminException.ConflictException - Namespace already exists
      PulsarAdminException - Unexpected error
    • createNamespaceAsync

      CompletableFuture<Void> createNamespaceAsync(String namespace, Set<String> clusters)
      Create a new namespace asynchronously.

      Creates a new empty namespace with no policies attached.

      Parameters:
      namespace - Namespace name
      clusters - Clusters in which the namespace will be present. If more than one cluster is present, replication across clusters will be enabled.
    • createNamespace

      void createNamespace(String namespace, Policies policies) throws PulsarAdminException
      Create a new namespace.

      Creates a new namespace with the specified policies.

      Parameters:
      namespace - Namespace name
      policies - Policies for the namespace
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Tenant or cluster does not exist
      PulsarAdminException.ConflictException - Namespace already exists
      PulsarAdminException - Unexpected error
      Since:
      2.0
    • createNamespaceAsync

      CompletableFuture<Void> createNamespaceAsync(String namespace, Policies policies)
      Create a new namespace asynchronously.

      Creates a new namespace with the specified policies.

      Parameters:
      namespace - Namespace name
      policies - Policies for the namespace
    • deleteNamespace

      void deleteNamespace(String namespace) throws PulsarAdminException
      Delete an existing namespace.

      The namespace needs to be empty.

      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.ConflictException - Namespace is not empty
      PulsarAdminException - Unexpected error
    • deleteNamespace

      void deleteNamespace(String namespace, boolean force) throws PulsarAdminException
      Delete an existing namespace.

      Force flag deletes namespace forcefully by force deleting all topics under it.

      Parameters:
      namespace - Namespace name
      force - Delete namespace forcefully
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.ConflictException - Namespace is not empty
      PulsarAdminException - Unexpected error
    • deleteNamespaceAsync

      CompletableFuture<Void> deleteNamespaceAsync(String namespace)
      Delete an existing namespace asynchronously.

      The namespace needs to be empty.

      Parameters:
      namespace - Namespace name
    • deleteNamespaceAsync

      CompletableFuture<Void> deleteNamespaceAsync(String namespace, boolean force)
      Delete an existing namespace asynchronously.

      Force flag deletes namespace forcefully by force deleting all topics under it.

      Parameters:
      namespace - Namespace name
      force - Delete namespace forcefully
    • deleteNamespaceBundle

      void deleteNamespaceBundle(String namespace, String bundleRange) throws PulsarAdminException
      Delete an existing bundle in a namespace.

      The bundle needs to be empty.

      Parameters:
      namespace - Namespace name
      bundleRange - range of the bundle
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Namespace/bundle does not exist
      PulsarAdminException.ConflictException - Bundle is not empty
      PulsarAdminException - Unexpected error
    • deleteNamespaceBundle

      void deleteNamespaceBundle(String namespace, String bundleRange, boolean force) throws PulsarAdminException
      Delete an existing bundle in a namespace.

      Force flag deletes bundle forcefully.

      Parameters:
      namespace - Namespace name
      bundleRange - range of the bundle
      force - Delete bundle forcefully
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Namespace/bundle does not exist
      PulsarAdminException.ConflictException - Bundle is not empty
      PulsarAdminException - Unexpected error
    • deleteNamespaceBundleAsync

      CompletableFuture<Void> deleteNamespaceBundleAsync(String namespace, String bundleRange)
      Delete an existing bundle in a namespace asynchronously.

      The bundle needs to be empty.

      Parameters:
      namespace - Namespace name
      bundleRange - range of the bundle
      Returns:
      a future that can be used to track when the bundle is deleted
    • deleteNamespaceBundleAsync

      CompletableFuture<Void> deleteNamespaceBundleAsync(String namespace, String bundleRange, boolean force)
      Delete an existing bundle in a namespace asynchronously.

      Force flag deletes bundle forcefully.

      Parameters:
      namespace - Namespace name
      bundleRange - range of the bundle
      force - Delete bundle forcefully
      Returns:
      a future that can be used to track when the bundle is deleted
    • getPermissions

      Map<String,Set<AuthAction>> getPermissions(String namespace) throws PulsarAdminException
      Get permissions on a namespace.

      Retrieve the permissions for a namespace.

      Response example:

       {
         "my-role" : [ "produce" ]
         "other-role" : [ "consume" ]
       }
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getPermissionsAsync

      CompletableFuture<Map<String,Set<AuthAction>>> getPermissionsAsync(String namespace)
      Get permissions on a namespace asynchronously.

      Retrieve the permissions for a namespace.

      Response example:

       {
         "my-role" : [ "produce" ]
         "other-role" : [ "consume" ]
       }
       
      Parameters:
      namespace - Namespace name
    • grantPermissionOnNamespace

      void grantPermissionOnNamespace(String namespace, String role, Set<AuthAction> actions) throws PulsarAdminException
      Grant permission on a namespace.

      Grant a new permission to a client role on a namespace.

      Request parameter example:

       ["produce", "consume"]
       
      Parameters:
      namespace - Namespace name
      role - Client role to which grant permission
      actions - Auth actions (produce and consume)
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.ConflictException - Concurrent modification
      PulsarAdminException - Unexpected error
    • grantPermissionOnNamespaceAsync

      CompletableFuture<Void> grantPermissionOnNamespaceAsync(String namespace, String role, Set<AuthAction> actions)
      Grant permission on a namespace asynchronously.

      Grant a new permission to a client role on a namespace.

      Request parameter example:

       ["produce", "consume"]
       
      Parameters:
      namespace - Namespace name
      role - Client role to which grant permission
      actions - Auth actions (produce and consume)
    • revokePermissionsOnNamespace

      void revokePermissionsOnNamespace(String namespace, String role) throws PulsarAdminException
      Revoke permissions on a namespace.

      Revoke all permissions to a client role on a namespace.

      Parameters:
      namespace - Namespace name
      role - Client role to which remove permissions
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • revokePermissionsOnNamespaceAsync

      CompletableFuture<Void> revokePermissionsOnNamespaceAsync(String namespace, String role)
      Revoke permissions on a namespace asynchronously.

      Revoke all permissions to a client role on a namespace.

      Parameters:
      namespace - Namespace name
      role - Client role to which remove permissions
    • getPermissionOnSubscription

      Map<String,Set<String>> getPermissionOnSubscription(String namespace) throws PulsarAdminException
      Get permission to role to access subscription's admin-api.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • getPermissionOnSubscriptionAsync

      CompletableFuture<Map<String,Set<String>>> getPermissionOnSubscriptionAsync(String namespace)
      Get permission to role to access subscription's admin-api asynchronously.
      Parameters:
      namespace -
    • grantPermissionOnSubscription

      void grantPermissionOnSubscription(String namespace, String subscription, Set<String> roles) throws PulsarAdminException
      Grant permission to role to access subscription's admin-api.
      Parameters:
      namespace -
      subscription -
      roles -
      Throws:
      PulsarAdminException
    • grantPermissionOnSubscriptionAsync

      CompletableFuture<Void> grantPermissionOnSubscriptionAsync(String namespace, String subscription, Set<String> roles)
      Grant permission to role to access subscription's admin-api asynchronously.
      Parameters:
      namespace -
      subscription -
      roles -
    • revokePermissionOnSubscription

      void revokePermissionOnSubscription(String namespace, String subscription, String role) throws PulsarAdminException
      Revoke permissions on a subscription's admin-api access.
      Parameters:
      namespace -
      subscription -
      role -
      Throws:
      PulsarAdminException
    • revokePermissionOnSubscriptionAsync

      CompletableFuture<Void> revokePermissionOnSubscriptionAsync(String namespace, String subscription, String role)
      Revoke permissions on a subscription's admin-api access asynchronously.
      Parameters:
      namespace -
      subscription -
      role -
    • getNamespaceReplicationClusters

      List<String> getNamespaceReplicationClusters(String namespace) throws PulsarAdminException
      Get the replication clusters for a namespace.

      Response example:

       ["use", "usw", "usc"]
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.PreconditionFailedException - Namespace is not global
      PulsarAdminException - Unexpected error
    • getNamespaceReplicationClustersAsync

      CompletableFuture<List<String>> getNamespaceReplicationClustersAsync(String namespace)
      Get the replication clusters for a namespace asynchronously.

      Response example:

       ["use", "usw", "usc"]
       
      Parameters:
      namespace - Namespace name
    • setNamespaceReplicationClusters

      void setNamespaceReplicationClusters(String namespace, Set<String> clusterIds) throws PulsarAdminException
      Set the replication clusters for a namespace.

      Request example:

       ["us-west", "us-east", "us-cent"]
       
      Parameters:
      namespace - Namespace name
      clusterIds - Pulsar Cluster Ids
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.PreconditionFailedException - Namespace is not global
      PulsarAdminException.PreconditionFailedException - Invalid cluster ids
      PulsarAdminException - Unexpected error
    • setNamespaceReplicationClustersAsync

      CompletableFuture<Void> setNamespaceReplicationClustersAsync(String namespace, Set<String> clusterIds)
      Set the replication clusters for a namespace asynchronously.

      Request example:

       ["us-west", "us-east", "us-cent"]
       
      Parameters:
      namespace - Namespace name
      clusterIds - Pulsar Cluster Ids
    • getNamespaceMessageTTL

      Integer getNamespaceMessageTTL(String namespace) throws PulsarAdminException
      Get the message TTL for a namespace.

      Response example:

       60
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getNamespaceMessageTTLAsync

      CompletableFuture<Integer> getNamespaceMessageTTLAsync(String namespace)
      Get the message TTL for a namespace asynchronously.

      Response example:

       60
       
      Parameters:
      namespace - Namespace name
    • setNamespaceMessageTTL

      void setNamespaceMessageTTL(String namespace, int ttlInSeconds) throws PulsarAdminException
      Set the messages Time to Live for all the topics within a namespace.

      Request example:

       60
       
      Parameters:
      namespace - Namespace name
      ttlInSeconds - TTL values for all messages for all topics in this namespace
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setNamespaceMessageTTLAsync

      CompletableFuture<Void> setNamespaceMessageTTLAsync(String namespace, int ttlInSeconds)
      Set the messages Time to Live for all the topics within a namespace asynchronously.

      Request example:

       60
       
      Parameters:
      namespace - Namespace name
      ttlInSeconds - TTL values for all messages for all topics in this namespace
    • removeNamespaceMessageTTL

      void removeNamespaceMessageTTL(String namespace) throws PulsarAdminException
      Remove the messages Time to Live for all the topics within a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeNamespaceMessageTTLAsync

      CompletableFuture<Void> removeNamespaceMessageTTLAsync(String namespace)
      Remove the messages Time to Live for all the topics within a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getSubscriptionExpirationTime

      Integer getSubscriptionExpirationTime(String namespace) throws PulsarAdminException
      Get the subscription expiration time for a namespace.

      Response example:

       1440
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getSubscriptionExpirationTimeAsync

      CompletableFuture<Integer> getSubscriptionExpirationTimeAsync(String namespace)
      Get the subscription expiration time for a namespace asynchronously.

      Response example:

       1440
       
      Parameters:
      namespace - Namespace name
    • setSubscriptionExpirationTime

      void setSubscriptionExpirationTime(String namespace, int expirationTime) throws PulsarAdminException
      Set the subscription expiration time in minutes for all the topics within a namespace.

      Request example:

       1440
       
      Parameters:
      namespace - Namespace name
      expirationTime - Expiration time values for all subscriptions for all topics in this namespace
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setSubscriptionExpirationTimeAsync

      CompletableFuture<Void> setSubscriptionExpirationTimeAsync(String namespace, int expirationTime)
      Set the subscription expiration time in minutes for all the topics within a namespace asynchronously.

      Request example:

       1440
       
      Parameters:
      namespace - Namespace name
      expirationTime - Expiration time values for all subscriptions for all topics in this namespace
    • removeSubscriptionExpirationTime

      void removeSubscriptionExpirationTime(String namespace) throws PulsarAdminException
      Remove the subscription expiration time for a namespace.
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • removeSubscriptionExpirationTimeAsync

      CompletableFuture<Void> removeSubscriptionExpirationTimeAsync(String namespace)
      Remove the subscription expiration time for a namespace asynchronously.
      Parameters:
      namespace - Namespace name
    • setNamespaceAntiAffinityGroup

      void setNamespaceAntiAffinityGroup(String namespace, String namespaceAntiAffinityGroup) throws PulsarAdminException
      Set anti-affinity group name for a namespace.

      Request example:

      Parameters:
      namespace - Namespace name
      namespaceAntiAffinityGroup - anti-affinity group name for a namespace
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setNamespaceAntiAffinityGroupAsync

      CompletableFuture<Void> setNamespaceAntiAffinityGroupAsync(String namespace, String namespaceAntiAffinityGroup)
      Set anti-affinity group name for a namespace asynchronously.

      Request example:

      Parameters:
      namespace - Namespace name
      namespaceAntiAffinityGroup - anti-affinity group name for a namespace
    • getAntiAffinityNamespaces

      List<String> getAntiAffinityNamespaces(String tenant, String cluster, String namespaceAntiAffinityGroup) throws PulsarAdminException
      Get all namespaces that grouped with given anti-affinity group.
      Parameters:
      tenant - tenant is only used for authorization. Client has to be admin of any of the tenant to access this api api.
      cluster - cluster name
      namespaceAntiAffinityGroup - Anti-affinity group name
      Returns:
      list of namespace grouped under a given anti-affinity group
      Throws:
      PulsarAdminException
    • getAntiAffinityNamespacesAsync

      CompletableFuture<List<String>> getAntiAffinityNamespacesAsync(String tenant, String cluster, String namespaceAntiAffinityGroup)
      Get all namespaces that grouped with given anti-affinity group asynchronously.
      Parameters:
      tenant - tenant is only used for authorization. Client has to be admin of any of the tenant to access this api api.
      cluster - cluster name
      namespaceAntiAffinityGroup - Anti-affinity group name
      Returns:
      list of namespace grouped under a given anti-affinity group
    • getNamespaceAntiAffinityGroup

      String getNamespaceAntiAffinityGroup(String namespace) throws PulsarAdminException
      Get anti-affinity group name for a namespace.

      Response example:

       60
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getNamespaceAntiAffinityGroupAsync

      CompletableFuture<String> getNamespaceAntiAffinityGroupAsync(String namespace)
      Get anti-affinity group name for a namespace asynchronously.

      Response example:

       60
       
      Parameters:
      namespace - Namespace name
    • deleteNamespaceAntiAffinityGroup

      void deleteNamespaceAntiAffinityGroup(String namespace) throws PulsarAdminException
      Delete anti-affinity group name for a namespace.
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - You don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • deleteNamespaceAntiAffinityGroupAsync

      CompletableFuture<Void> deleteNamespaceAntiAffinityGroupAsync(String namespace)
      Delete anti-affinity group name for a namespace.
      Parameters:
      namespace - Namespace name
    • removeDeduplicationStatus

      void removeDeduplicationStatus(String namespace) throws PulsarAdminException
      Remove the deduplication status for all topics within a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeDeduplicationStatusAsync

      CompletableFuture<Void> removeDeduplicationStatusAsync(String namespace)
      Get the deduplication status for all topics within a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getDeduplicationStatus

      Boolean getDeduplicationStatus(String namespace) throws PulsarAdminException
      Get the deduplication status for all topics within a namespace .
      Parameters:
      namespace -
      Returns:
      Throws:
      PulsarAdminException
    • getDeduplicationStatusAsync

      CompletableFuture<Boolean> getDeduplicationStatusAsync(String namespace)
      Get the deduplication status for all topics within a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • setDeduplicationStatus

      void setDeduplicationStatus(String namespace, boolean enableDeduplication) throws PulsarAdminException
      Set the deduplication status for all topics within a namespace.

      When deduplication is enabled, the broker will prevent to store the same message multiple times.

      Request example:

       true
       
      Parameters:
      namespace - Namespace name
      enableDeduplication - wether to enable or disable deduplication feature
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setDeduplicationStatusAsync

      CompletableFuture<Void> setDeduplicationStatusAsync(String namespace, boolean enableDeduplication)
      Set the deduplication status for all topics within a namespace asynchronously.

      When deduplication is enabled, the broker will prevent to store the same message multiple times.

      Request example:

       true
       
      Parameters:
      namespace - Namespace name
      enableDeduplication - wether to enable or disable deduplication feature
    • setAutoTopicCreation

      void setAutoTopicCreation(String namespace, AutoTopicCreationOverride autoTopicCreationOverride) throws PulsarAdminException
      Sets the autoTopicCreation policy for a given namespace, overriding broker settings.

      When autoTopicCreationOverride is enabled, new topics will be created upon connection, regardless of the broker level configuration.

      Request example:

       
        {
            "allowAutoTopicCreation" : true,
            "topicType" : "partitioned",
            "defaultNumPartitions": 2
        }
       
       
      Parameters:
      namespace - Namespace name
      autoTopicCreationOverride - Override policies for auto topic creation
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setAutoTopicCreationAsync

      CompletableFuture<Void> setAutoTopicCreationAsync(String namespace, AutoTopicCreationOverride autoTopicCreationOverride)
      Sets the autoTopicCreation policy for a given namespace, overriding broker settings asynchronously.

      When autoTopicCreationOverride is enabled, new topics will be created upon connection, regardless of the broker level configuration.

      Request example:

       
        {
            "allowAutoTopicCreation" : true,
            "topicType" : "partitioned",
            "defaultNumPartitions": 2
        }
       
       
      Parameters:
      namespace - Namespace name
      autoTopicCreationOverride - Override policies for auto topic creation
    • getAutoTopicCreation

      AutoTopicCreationOverride getAutoTopicCreation(String namespace) throws PulsarAdminException
      Get the autoTopicCreation info within a namespace.
      Parameters:
      namespace -
      Returns:
      Throws:
      PulsarAdminException
    • getAutoTopicCreationAsync

      CompletableFuture<AutoTopicCreationOverride> getAutoTopicCreationAsync(String namespace)
      Get the autoTopicCreation info within a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • removeAutoTopicCreation

      void removeAutoTopicCreation(String namespace) throws PulsarAdminException
      Removes the autoTopicCreation policy for a given namespace.

      Allowing the broker to dictate the auto-creation policy.

      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • removeAutoTopicCreationAsync

      CompletableFuture<Void> removeAutoTopicCreationAsync(String namespace)
      Removes the autoTopicCreation policy for a given namespace asynchronously.

      Allowing the broker to dictate the auto-creation policy.

      Parameters:
      namespace - Namespace name
    • setAutoSubscriptionCreation

      void setAutoSubscriptionCreation(String namespace, AutoSubscriptionCreationOverride autoSubscriptionCreationOverride) throws PulsarAdminException
      Sets the autoSubscriptionCreation policy for a given namespace, overriding broker settings.

      When autoSubscriptionCreationOverride is enabled, new subscriptions will be created upon connection, regardless of the broker level configuration.

      Request example:

       
        {
            "allowAutoSubscriptionCreation" : true
        }
       
       
      Parameters:
      namespace - Namespace name
      autoSubscriptionCreationOverride - Override policies for auto subscription creation
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setAutoSubscriptionCreationAsync

      CompletableFuture<Void> setAutoSubscriptionCreationAsync(String namespace, AutoSubscriptionCreationOverride autoSubscriptionCreationOverride)
      Sets the autoSubscriptionCreation policy for a given namespace, overriding broker settings asynchronously.

      When autoSubscriptionCreationOverride is enabled, new subscriptions will be created upon connection, regardless of the broker level configuration.

      Request example:

       
        {
            "allowAutoSubscriptionCreation" : true
        }
       
       
      Parameters:
      namespace - Namespace name
      autoSubscriptionCreationOverride - Override policies for auto subscription creation
    • getAutoSubscriptionCreation

      AutoSubscriptionCreationOverride getAutoSubscriptionCreation(String namespace) throws PulsarAdminException
      Get the autoSubscriptionCreation info within a namespace.
      Parameters:
      namespace -
      Returns:
      Throws:
      PulsarAdminException
    • getAutoSubscriptionCreationAsync

      CompletableFuture<AutoSubscriptionCreationOverride> getAutoSubscriptionCreationAsync(String namespace)
      Get the autoSubscriptionCreation info within a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • setSubscriptionTypesEnabled

      void setSubscriptionTypesEnabled(String namespace, Set<org.apache.pulsar.client.api.SubscriptionType> subscriptionTypesEnabled) throws PulsarAdminException
      Sets the subscriptionTypesEnabled policy for a given namespace, overriding broker settings. Request example:
       
        {
            "subscriptionTypesEnabled" : {"Shared", "Failover"}
        }
       
       
      Parameters:
      namespace - Namespace name
      subscriptionTypesEnabled - is enable subscription types
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setSubscriptionTypesEnabledAsync

      CompletableFuture<Void> setSubscriptionTypesEnabledAsync(String namespace, Set<org.apache.pulsar.client.api.SubscriptionType> subscriptionTypesEnabled)
      Sets the subscriptionTypesEnabled policy for a given namespace, overriding broker settings. Request example:
       
        {
            "subscriptionTypesEnabled" : {"Shared", "Failover"}
        }
       
       
      Parameters:
      namespace - Namespace name
      subscriptionTypesEnabled - is enable subscription types
    • getSubscriptionTypesEnabled

      Set<org.apache.pulsar.client.api.SubscriptionType> getSubscriptionTypesEnabled(String namespace) throws PulsarAdminException
      Get the subscriptionTypesEnabled policy for a given namespace, overriding broker settings.
      Parameters:
      namespace - Namespace name
      Returns:
      subscription types Set<org.apache.pulsar.client.api.SubscriptionType> the subscription types
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getSubscriptionTypesEnabledAsync

      CompletableFuture<Set<org.apache.pulsar.client.api.SubscriptionType>> getSubscriptionTypesEnabledAsync(String namespace)
      Get the subscriptionTypesEnabled policy for a given namespace, overriding broker settings.
      Parameters:
      namespace - Namespace name
      Returns:
      the future of subscription types Set<org.apache.pulsar.client.api.SubscriptionType> the subscription types
    • removeSubscriptionTypesEnabled

      void removeSubscriptionTypesEnabled(String namespace) throws PulsarAdminException
      Removes the subscriptionTypesEnabled policy for a given namespace.
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • removeSubscriptionTypesEnabledAsync

      CompletableFuture<Void> removeSubscriptionTypesEnabledAsync(String namespace)
      Removes the subscriptionTypesEnabled policy for a given namespace.
      Parameters:
      namespace - Namespace name
      Returns:
    • removeAutoSubscriptionCreation

      void removeAutoSubscriptionCreation(String namespace) throws PulsarAdminException
      Removes the autoSubscriptionCreation policy for a given namespace.

      Allowing the broker to dictate the subscription auto-creation policy.

      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • removeAutoSubscriptionCreationAsync

      CompletableFuture<Void> removeAutoSubscriptionCreationAsync(String namespace)
      Removes the autoSubscriptionCreation policy for a given namespace asynchronously.

      Allowing the broker to dictate the subscription auto-creation policy.

      Parameters:
      namespace - Namespace name
    • getBacklogQuotaMap

      Get backlog quota map on a namespace.

      Get backlog quota map on a namespace.

      Response example:

       
        {
            "namespace_memory" : {
                "limit" : "134217728",
                "policy" : "consumer_backlog_eviction"
            },
            "destination_storage" : {
                "limit" : "-1",
                "policy" : "producer_exception"
            }
        }
       
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Permission denied
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getBacklogQuotaMapAsync

      Get backlog quota map on a namespace asynchronously.

      Get backlog quota map on a namespace.

      Response example:

       
        {
            "namespace_memory" : {
                "limit" : "134217728",
                "policy" : "consumer_backlog_eviction"
            },
            "destination_storage" : {
                "limit" : "-1",
                "policy" : "producer_exception"
            }
        }
       
       
      Parameters:
      namespace - Namespace name
    • setBacklogQuota

      void setBacklogQuota(String namespace, BacklogQuota backlogQuota, BacklogQuota.BacklogQuotaType backlogQuotaType) throws PulsarAdminException
      Set a backlog quota for all the topics on a namespace.

      Set a backlog quota on a namespace.

      The backlog quota can be set on this resource:

      Request parameter example:

       
       {
           "limit" : "134217728",
           "policy" : "consumer_backlog_eviction"
       }
       
       
      Parameters:
      namespace - Namespace name
      backlogQuota - the new BacklogQuota
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setBacklogQuota

      default void setBacklogQuota(String namespace, BacklogQuota backlogQuota) throws PulsarAdminException
      Throws:
      PulsarAdminException
    • setBacklogQuotaAsync

      CompletableFuture<Void> setBacklogQuotaAsync(String namespace, BacklogQuota backlogQuota, BacklogQuota.BacklogQuotaType backlogQuotaType)
      Set a backlog quota for all the topics on a namespace asynchronously.

      Set a backlog quota on a namespace.

      The backlog quota can be set on this resource:

      Request parameter example:

       
       {
           "limit" : "134217728",
           "policy" : "consumer_backlog_eviction"
       }
       
       
      Parameters:
      namespace - Namespace name
      backlogQuota - the new BacklogQuota
    • setBacklogQuotaAsync

      default CompletableFuture<Void> setBacklogQuotaAsync(String namespace, BacklogQuota backlogQuota)
    • removeBacklogQuota

      void removeBacklogQuota(String namespace, BacklogQuota.BacklogQuotaType backlogQuotaType) throws PulsarAdminException
      Remove a backlog quota policy from a namespace.

      Remove a backlog quota policy from a namespace.

      The backlog retention policy will fall back to the default.

      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • removeBacklogQuota

      default void removeBacklogQuota(String namespace) throws PulsarAdminException
      Throws:
      PulsarAdminException
    • removeBacklogQuotaAsync

      CompletableFuture<Void> removeBacklogQuotaAsync(String namespace, BacklogQuota.BacklogQuotaType backlogQuotaType)
      Remove a backlog quota policy from a namespace asynchronously.

      Remove a backlog quota policy from a namespace.

      The backlog retention policy will fall back to the default.

      Parameters:
      namespace - Namespace name
    • removeBacklogQuotaAsync

      default CompletableFuture<Void> removeBacklogQuotaAsync(String namespace)
    • removePersistence

      void removePersistence(String namespace) throws PulsarAdminException
      Remove the persistence configuration on a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removePersistenceAsync

      CompletableFuture<Void> removePersistenceAsync(String namespace)
      Remove the persistence configuration on a namespace asynchronously.
      Parameters:
      namespace -
    • setPersistence

      void setPersistence(String namespace, PersistencePolicies persistence) throws PulsarAdminException
      Set the persistence configuration for all the topics on a namespace.

      Set the persistence configuration on a namespace.

      Request parameter example:

       
       {
           "bookkeeperEnsemble" : 3,                 // Number of bookies to use for a topic
           "bookkeeperWriteQuorum" : 2,              // How many writes to make of each entry
           "bookkeeperAckQuorum" : 2,                // Number of acks (guaranteed copies) to wait for each entry
           "managedLedgerMaxMarkDeleteRate" : 10.0,  // Throttling rate of mark-delete operation
                                                     // to avoid high number of updates for each
                                                     // consumer
       }
       
       
      Parameters:
      namespace - Namespace name
      persistence - Persistence policies object
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.ConflictException - Concurrent modification
      PulsarAdminException - Unexpected error
    • setPersistenceAsync

      CompletableFuture<Void> setPersistenceAsync(String namespace, PersistencePolicies persistence)
      Set the persistence configuration for all the topics on a namespace asynchronously.

      Set the persistence configuration on a namespace.

      Request parameter example:

       
       {
           "bookkeeperEnsemble" : 3,                 // Number of bookies to use for a topic
           "bookkeeperWriteQuorum" : 2,              // How many writes to make of each entry
           "bookkeeperAckQuorum" : 2,                // Number of acks (guaranteed copies) to wait for each entry
           "managedLedgerMaxMarkDeleteRate" : 10.0,  // Throttling rate of mark-delete operation
                                                     // to avoid high number of updates for each
                                                     // consumer
       }
       
       
      Parameters:
      namespace - Namespace name
      persistence - Persistence policies object
    • getPersistence

      PersistencePolicies getPersistence(String namespace) throws PulsarAdminException
      Get the persistence configuration for a namespace.

      Get the persistence configuration for a namespace.

      Response example:

       
       {
           "bookkeeperEnsemble" : 3,                 // Number of bookies to use for a topic
           "bookkeeperWriteQuorum" : 2,              // How many writes to make of each entry
           "bookkeeperAckQuorum" : 2,                // Number of acks (guaranteed copies) to wait for each entry
           "managedLedgerMaxMarkDeleteRate" : 10.0,  // Throttling rate of mark-delete operation
                                                     // to avoid high number of updates for each
                                                     // consumer
       }
       
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.ConflictException - Concurrent modification
      PulsarAdminException - Unexpected error
    • getPersistenceAsync

      CompletableFuture<PersistencePolicies> getPersistenceAsync(String namespace)
      Get the persistence configuration for a namespace asynchronously.

      Get the persistence configuration for a namespace.

      Response example:

       
       {
           "bookkeeperEnsemble" : 3,                 // Number of bookies to use for a topic
           "bookkeeperWriteQuorum" : 2,              // How many writes to make of each entry
           "bookkeeperAckQuorum" : 2,                // Number of acks (guaranteed copies) to wait for each entry
           "managedLedgerMaxMarkDeleteRate" : 10.0,  // Throttling rate of mark-delete operation
                                                     // to avoid high number of updates for each
                                                     // consumer
       }
       
       
      Parameters:
      namespace - Namespace name
    • setBookieAffinityGroup

      void setBookieAffinityGroup(String namespace, BookieAffinityGroupData bookieAffinityGroup) throws PulsarAdminException
      Set bookie affinity group for a namespace to isolate namespace write to bookies that are part of given affinity group.
      Parameters:
      namespace - namespace name
      bookieAffinityGroup - bookie affinity group
      Throws:
      PulsarAdminException
    • setBookieAffinityGroupAsync

      CompletableFuture<Void> setBookieAffinityGroupAsync(String namespace, BookieAffinityGroupData bookieAffinityGroup)
      Set bookie affinity group for a namespace to isolate namespace write to bookies that are part of given affinity group asynchronously.
      Parameters:
      namespace - namespace name
      bookieAffinityGroup - bookie affinity group
    • deleteBookieAffinityGroup

      void deleteBookieAffinityGroup(String namespace) throws PulsarAdminException
      Delete bookie affinity group configured for a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • deleteBookieAffinityGroupAsync

      CompletableFuture<Void> deleteBookieAffinityGroupAsync(String namespace)
      Delete bookie affinity group configured for a namespace asynchronously.
      Parameters:
      namespace -
    • getBookieAffinityGroup

      BookieAffinityGroupData getBookieAffinityGroup(String namespace) throws PulsarAdminException
      Get bookie affinity group configured for a namespace.
      Parameters:
      namespace -
      Returns:
      Throws:
      PulsarAdminException
    • getBookieAffinityGroupAsync

      CompletableFuture<BookieAffinityGroupData> getBookieAffinityGroupAsync(String namespace)
      Get bookie affinity group configured for a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • setRetention

      void setRetention(String namespace, RetentionPolicies retention) throws PulsarAdminException
      Set the retention configuration for all the topics on a namespace.

      Set the retention configuration on a namespace. This operation requires Pulsar super-user access.

      Request parameter example:

       
       {
           "retentionTimeInMinutes" : 60,            // how long to retain messages
           "retentionSizeInMB" : 1024,              // retention backlog limit
       }
       
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.ConflictException - Concurrent modification
      PulsarAdminException - Unexpected error
    • setRetentionAsync

      CompletableFuture<Void> setRetentionAsync(String namespace, RetentionPolicies retention)
      Set the retention configuration for all the topics on a namespace asynchronously.

      Set the retention configuration on a namespace. This operation requires Pulsar super-user access.

      Request parameter example:

       
       {
           "retentionTimeInMinutes" : 60,            // how long to retain messages
           "retentionSizeInMB" : 1024,              // retention backlog limit
       }
       
       
      Parameters:
      namespace - Namespace name
    • removeRetention

      void removeRetention(String namespace) throws PulsarAdminException
      Remove the retention configuration for all the topics on a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeRetentionAsync

      CompletableFuture<Void> removeRetentionAsync(String namespace)
      Remove the retention configuration for all the topics on a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getRetention

      RetentionPolicies getRetention(String namespace) throws PulsarAdminException
      Get the retention configuration for a namespace.

      Get the retention configuration for a namespace.

      Response example:

       
       {
           "retentionTimeInMinutes" : 60,            // how long to retain messages
           "retentionSizeInMB" : 1024,              // retention backlog limit
       }
       
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.ConflictException - Concurrent modification
      PulsarAdminException - Unexpected error
    • getRetentionAsync

      CompletableFuture<RetentionPolicies> getRetentionAsync(String namespace)
      Get the retention configuration for a namespace asynchronously.

      Get the retention configuration for a namespace.

      Response example:

       
       {
           "retentionTimeInMinutes" : 60,            // how long to retain messages
           "retentionSizeInMB" : 1024,              // retention backlog limit
       }
       
       
      Parameters:
      namespace - Namespace name
    • unload

      void unload(String namespace) throws PulsarAdminException
      Unload a namespace from the current serving broker.
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.PreconditionFailedException - Namespace is already unloaded
      PulsarAdminException - Unexpected error
    • unloadAsync

      CompletableFuture<Void> unloadAsync(String namespace)
      Unload a namespace from the current serving broker asynchronously.
      Parameters:
      namespace - Namespace name
    • getReplicationConfigVersion

      String getReplicationConfigVersion(String namespace) throws PulsarAdminException
      Get the replication configuration version for a given namespace.
      Parameters:
      namespace -
      Returns:
      Replication configuration version
      Throws:
      PulsarAdminException - Unexpected error
    • getReplicationConfigVersionAsync

      CompletableFuture<String> getReplicationConfigVersionAsync(String namespace)
      Get the replication configuration version for a given namespace asynchronously.
      Parameters:
      namespace -
      Returns:
      Replication configuration version
    • unloadNamespaceBundle

      void unloadNamespaceBundle(String namespace, String bundle) throws PulsarAdminException
      Unload namespace bundle.
      Parameters:
      namespace -
      bundle - range of bundle to unload
      Throws:
      PulsarAdminException - Unexpected error
    • unloadNamespaceBundle

      void unloadNamespaceBundle(String namespace, String bundle, String destinationBroker) throws PulsarAdminException
      Unload namespace bundle and assign the bundle to specified broker.
      Parameters:
      namespace -
      bundle - range of bundle to unload
      destinationBroker - Target broker url to which the bundle should be assigned to
      Throws:
      PulsarAdminException - Unexpected error
    • unloadNamespaceBundleAsync

      CompletableFuture<Void> unloadNamespaceBundleAsync(String namespace, String bundle)
      Unload namespace bundle asynchronously.
      Parameters:
      namespace -
      bundle - range of bundle to unload
      Returns:
      a future that can be used to track when the bundle is unloaded
    • unloadNamespaceBundleAsync

      CompletableFuture<Void> unloadNamespaceBundleAsync(String namespace, String bundle, String destinationBroker)
      Unload namespace bundle asynchronously.
      Parameters:
      namespace -
      bundle - range of bundle to unload
      destinationBroker - Target broker url to which the bundle should be assigned to
      Returns:
      a future that can be used to track when the bundle is unloaded
    • splitNamespaceBundle

      void splitNamespaceBundle(String namespace, String bundle, boolean unloadSplitBundles, String splitAlgorithmName) throws PulsarAdminException
      Split namespace bundle.
      Parameters:
      namespace -
      bundle - range of bundle to split
      unloadSplitBundles -
      splitAlgorithmName -
      Throws:
      PulsarAdminException
    • splitNamespaceBundleAsync

      CompletableFuture<Void> splitNamespaceBundleAsync(String namespace, String bundle, boolean unloadSplitBundles, String splitAlgorithmName)
      Split namespace bundle asynchronously.
      Parameters:
      namespace -
      bundle - range of bundle to split
      unloadSplitBundles -
      splitAlgorithmName -
    • splitNamespaceBundle

      void splitNamespaceBundle(String namespace, String bundle, boolean unloadSplitBundles, String splitAlgorithmName, List<Long> splitBoundaries) throws PulsarAdminException
      Split namespace bundle.
      Parameters:
      namespace -
      bundle - range of bundle to split
      unloadSplitBundles -
      splitAlgorithmName -
      splitBoundaries -
      Throws:
      PulsarAdminException
    • splitNamespaceBundleAsync

      CompletableFuture<Void> splitNamespaceBundleAsync(String namespace, String bundle, boolean unloadSplitBundles, String splitAlgorithmName, List<Long> splitBoundaries)
      Split namespace bundle asynchronously.
      Parameters:
      namespace -
      bundle - range of bundle to split
      unloadSplitBundles -
      splitAlgorithmName -
      splitBoundaries -
    • getTopicHashPositions

      TopicHashPositions getTopicHashPositions(String namespace, String bundle, List<String> topics) throws PulsarAdminException
      Get positions for topic list in a bundle.
      Parameters:
      namespace -
      bundle - range of bundle
      topics -
      Returns:
      hash positions for all topics in topicList
      Throws:
      PulsarAdminException
    • getTopicHashPositionsAsync

      CompletableFuture<TopicHashPositions> getTopicHashPositionsAsync(String namespace, String bundle, List<String> topics)
      Get positions for topic list in a bundle.
      Parameters:
      namespace -
      bundle - range of bundle
      topics -
      Returns:
      hash positions for all topics in topicList
      Throws:
      PulsarAdminException
    • setPublishRate

      void setPublishRate(String namespace, PublishRate publishMsgRate) throws PulsarAdminException
      Set message-publish-rate (topics under this namespace can publish this many messages per second).
      Parameters:
      namespace -
      publishMsgRate - number of messages per second
      Throws:
      PulsarAdminException - Unexpected error
    • removePublishRate

      void removePublishRate(String namespace) throws PulsarAdminException
      Remove message-publish-rate (topics under this namespace can publish this many messages per second).
      Parameters:
      namespace -
      Throws:
      PulsarAdminException - Unexpected error
    • setPublishRateAsync

      CompletableFuture<Void> setPublishRateAsync(String namespace, PublishRate publishMsgRate)
      Set message-publish-rate (topics under this namespace can publish this many messages per second) asynchronously.
      Parameters:
      namespace -
      publishMsgRate - number of messages per second
    • removePublishRateAsync

      CompletableFuture<Void> removePublishRateAsync(String namespace)
      Remove message-publish-rate asynchronously.

      topics under this namespace can publish this many messages per second

      Parameters:
      namespace -
    • getPublishRate

      PublishRate getPublishRate(String namespace) throws PulsarAdminException
      Get message-publish-rate (topics under this namespace can publish this many messages per second).
      Parameters:
      namespace -
      Returns:
      number of messages per second
      Throws:
      PulsarAdminException - Unexpected error
    • getPublishRateAsync

      CompletableFuture<PublishRate> getPublishRateAsync(String namespace)
      Get message-publish-rate (topics under this namespace can publish this many messages per second) asynchronously.
      Parameters:
      namespace -
      Returns:
      number of messages per second
    • removeDispatchRate

      void removeDispatchRate(String namespace) throws PulsarAdminException
      Remove message-dispatch-rate.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeDispatchRateAsync

      CompletableFuture<Void> removeDispatchRateAsync(String namespace)
      Remove message-dispatch-rate asynchronously.
      Parameters:
      namespace -
      Returns:
    • setDispatchRate

      void setDispatchRate(String namespace, DispatchRate dispatchRate) throws PulsarAdminException
      Set message-dispatch-rate (topics under this namespace can dispatch this many messages per second).
      Parameters:
      namespace -
      dispatchRate - number of messages per second
      Throws:
      PulsarAdminException - Unexpected error
    • setDispatchRateAsync

      CompletableFuture<Void> setDispatchRateAsync(String namespace, DispatchRate dispatchRate)
      Set message-dispatch-rate asynchronously.

      topics under this namespace can dispatch this many messages per second

      Parameters:
      namespace -
      dispatchRate - number of messages per second
    • getDispatchRate

      DispatchRate getDispatchRate(String namespace) throws PulsarAdminException
      Get message-dispatch-rate (topics under this namespace can dispatch this many messages per second).
      Parameters:
      namespace -
      Throws:
      PulsarAdminException - Unexpected error
    • getDispatchRateAsync

      CompletableFuture<DispatchRate> getDispatchRateAsync(String namespace)
      Get message-dispatch-rate asynchronously.

      Topics under this namespace can dispatch this many messages per second.

      Parameters:
      namespace -
    • setSubscribeRate

      void setSubscribeRate(String namespace, SubscribeRate subscribeRate) throws PulsarAdminException
      Set namespace-subscribe-rate (topics under this namespace will limit by subscribeRate).
      Parameters:
      namespace -
      subscribeRate - consumer subscribe limit by this subscribeRate
      Throws:
      PulsarAdminException - Unexpected error
    • setSubscribeRateAsync

      CompletableFuture<Void> setSubscribeRateAsync(String namespace, SubscribeRate subscribeRate)
      Set namespace-subscribe-rate (topics under this namespace will limit by subscribeRate) asynchronously.
      Parameters:
      namespace -
      subscribeRate - consumer subscribe limit by this subscribeRate
    • removeSubscribeRate

      void removeSubscribeRate(String namespace) throws PulsarAdminException
      Remove namespace-subscribe-rate (topics under this namespace will limit by subscribeRate).
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeSubscribeRateAsync

      CompletableFuture<Void> removeSubscribeRateAsync(String namespace)
      Remove namespace-subscribe-rate (topics under this namespace will limit by subscribeRate) asynchronously.
      Parameters:
      namespace -
    • getSubscribeRate

      SubscribeRate getSubscribeRate(String namespace) throws PulsarAdminException
      Get namespace-subscribe-rate (topics under this namespace allow subscribe times per consumer in a period).
      Parameters:
      namespace -
      Throws:
      PulsarAdminException - Unexpected error
    • getSubscribeRateAsync

      CompletableFuture<SubscribeRate> getSubscribeRateAsync(String namespace)
      Get namespace-subscribe-rate asynchronously.

      Topics under this namespace allow subscribe times per consumer in a period.

      Parameters:
      namespace -
    • removeSubscriptionDispatchRate

      void removeSubscriptionDispatchRate(String namespace) throws PulsarAdminException
      Remove subscription-message-dispatch-rate.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeSubscriptionDispatchRateAsync

      CompletableFuture<Void> removeSubscriptionDispatchRateAsync(String namespace)
      Remove subscription-message-dispatch-rate asynchronously.
      Parameters:
      namespace -
      Returns:
    • setSubscriptionDispatchRate

      void setSubscriptionDispatchRate(String namespace, DispatchRate dispatchRate) throws PulsarAdminException
      Set subscription-message-dispatch-rate.

      Subscriptions under this namespace can dispatch this many messages per second

      Parameters:
      namespace -
      dispatchRate - number of messages per second
      Throws:
      PulsarAdminException - Unexpected error
    • setSubscriptionDispatchRateAsync

      CompletableFuture<Void> setSubscriptionDispatchRateAsync(String namespace, DispatchRate dispatchRate)
      Set subscription-message-dispatch-rate asynchronously.

      Subscriptions under this namespace can dispatch this many messages per second.

      Parameters:
      namespace -
      dispatchRate - number of messages per second
    • getSubscriptionDispatchRate

      DispatchRate getSubscriptionDispatchRate(String namespace) throws PulsarAdminException
      Get subscription-message-dispatch-rate.

      Subscriptions under this namespace can dispatch this many messages per second.

      Parameters:
      namespace -
      Throws:
      PulsarAdminException - Unexpected error
    • getSubscriptionDispatchRateAsync

      CompletableFuture<DispatchRate> getSubscriptionDispatchRateAsync(String namespace)
      Get subscription-message-dispatch-rate asynchronously.

      Subscriptions under this namespace can dispatch this many messages per second.

      Parameters:
      namespace -
    • setReplicatorDispatchRate

      void setReplicatorDispatchRate(String namespace, DispatchRate dispatchRate) throws PulsarAdminException
      Set replicator-message-dispatch-rate.

      Replicators under this namespace can dispatch this many messages per second.

      Parameters:
      namespace -
      dispatchRate - number of messages per second
      Throws:
      PulsarAdminException - Unexpected error
    • setReplicatorDispatchRateAsync

      CompletableFuture<Void> setReplicatorDispatchRateAsync(String namespace, DispatchRate dispatchRate)
      Set replicator-message-dispatch-rate asynchronously.

      Replicators under this namespace can dispatch this many messages per second.

      Parameters:
      namespace -
      dispatchRate - number of messages per second
    • removeReplicatorDispatchRate

      void removeReplicatorDispatchRate(String namespace) throws PulsarAdminException
      Remove replicator-message-dispatch-rate.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException - Unexpected error
    • removeReplicatorDispatchRateAsync

      CompletableFuture<Void> removeReplicatorDispatchRateAsync(String namespace)
      Set replicator-message-dispatch-rate asynchronously.
      Parameters:
      namespace -
    • getReplicatorDispatchRate

      DispatchRate getReplicatorDispatchRate(String namespace) throws PulsarAdminException
      Get replicator-message-dispatch-rate.

      Replicators under this namespace can dispatch this many messages per second.

      Parameters:
      namespace -
      Throws:
      PulsarAdminException - Unexpected error
    • getReplicatorDispatchRateAsync

      CompletableFuture<DispatchRate> getReplicatorDispatchRateAsync(String namespace)
      Get replicator-message-dispatch-rate asynchronously.

      Replicators under this namespace can dispatch this many messages per second.

      Parameters:
      namespace -
    • clearNamespaceBacklog

      void clearNamespaceBacklog(String namespace) throws PulsarAdminException
      Clear backlog for all topics on a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException - Unexpected error
    • clearNamespaceBacklogAsync

      CompletableFuture<Void> clearNamespaceBacklogAsync(String namespace)
      Clear backlog for all topics on a namespace asynchronously.
      Parameters:
      namespace -
    • clearNamespaceBacklogForSubscription

      void clearNamespaceBacklogForSubscription(String namespace, String subscription) throws PulsarAdminException
      Clear backlog for a given subscription on all topics on a namespace.
      Parameters:
      namespace -
      subscription -
      Throws:
      PulsarAdminException - Unexpected error
    • clearNamespaceBacklogForSubscriptionAsync

      CompletableFuture<Void> clearNamespaceBacklogForSubscriptionAsync(String namespace, String subscription)
      Clear backlog for a given subscription on all topics on a namespace asynchronously.
      Parameters:
      namespace -
      subscription -
    • clearNamespaceBundleBacklog

      void clearNamespaceBundleBacklog(String namespace, String bundle) throws PulsarAdminException
      Clear backlog for all topics on a namespace bundle.
      Parameters:
      namespace -
      bundle -
      Throws:
      PulsarAdminException - Unexpected error
    • clearNamespaceBundleBacklogAsync

      CompletableFuture<Void> clearNamespaceBundleBacklogAsync(String namespace, String bundle)
      Clear backlog for all topics on a namespace bundle asynchronously.
      Parameters:
      namespace -
      bundle -
      Returns:
      a future that can be used to track when the bundle is cleared
    • clearNamespaceBundleBacklogForSubscription

      void clearNamespaceBundleBacklogForSubscription(String namespace, String bundle, String subscription) throws PulsarAdminException
      Clear backlog for a given subscription on all topics on a namespace bundle.
      Parameters:
      namespace -
      bundle -
      subscription -
      Throws:
      PulsarAdminException - Unexpected error
    • clearNamespaceBundleBacklogForSubscriptionAsync

      CompletableFuture<Void> clearNamespaceBundleBacklogForSubscriptionAsync(String namespace, String bundle, String subscription)
      Clear backlog for a given subscription on all topics on a namespace bundle asynchronously.
      Parameters:
      namespace -
      bundle -
      subscription -
      Returns:
      a future that can be used to track when the bundle is cleared
    • unsubscribeNamespace

      void unsubscribeNamespace(String namespace, String subscription) throws PulsarAdminException
      Unsubscribe the given subscription on all topics on a namespace.
      Parameters:
      namespace -
      subscription -
      Throws:
      PulsarAdminException
    • unsubscribeNamespaceAsync

      CompletableFuture<Void> unsubscribeNamespaceAsync(String namespace, String subscription)
      Unsubscribe the given subscription on all topics on a namespace asynchronously.
      Parameters:
      namespace -
      subscription -
    • unsubscribeNamespaceBundle

      void unsubscribeNamespaceBundle(String namespace, String bundle, String subscription) throws PulsarAdminException
      Unsubscribe the given subscription on all topics on a namespace bundle.
      Parameters:
      namespace -
      bundle -
      subscription -
      Throws:
      PulsarAdminException
    • unsubscribeNamespaceBundleAsync

      CompletableFuture<Void> unsubscribeNamespaceBundleAsync(String namespace, String bundle, String subscription)
      Unsubscribe the given subscription on all topics on a namespace bundle asynchronously.
      Parameters:
      namespace -
      bundle -
      subscription -
      Returns:
      a future that can be used to track when the subscription is unsubscribed
    • setEncryptionRequiredStatus

      void setEncryptionRequiredStatus(String namespace, boolean encryptionRequired) throws PulsarAdminException
      Set the encryption required status for all topics within a namespace.

      When encryption required is true, the broker will prevent to store unencrypted messages.

      Request example:

       true
       
      Parameters:
      namespace - Namespace name
      encryptionRequired - whether message encryption is required or not
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getEncryptionRequiredStatus

      Boolean getEncryptionRequiredStatus(String namespace) throws PulsarAdminException
      Get the encryption required status within a namespace.
      Parameters:
      namespace -
      Returns:
      Throws:
      PulsarAdminException
    • getEncryptionRequiredStatusAsync

      CompletableFuture<Boolean> getEncryptionRequiredStatusAsync(String namespace)
      Get the encryption required status within a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • setEncryptionRequiredStatusAsync

      CompletableFuture<Void> setEncryptionRequiredStatusAsync(String namespace, boolean encryptionRequired)
      Set the encryption required status for all topics within a namespace asynchronously.

      When encryption required is true, the broker will prevent to store unencrypted messages.

      Request example:

       true
       
      Parameters:
      namespace - Namespace name
      encryptionRequired - whether message encryption is required or not
    • getDelayedDelivery

      DelayedDeliveryPolicies getDelayedDelivery(String namespace) throws PulsarAdminException
      Get the delayed delivery messages for all topics within a namespace.

      If disabled, messages will be immediately delivered and there will be no tracking overhead.

      Request example:

       
       {
           "active" : true,   // Enable or disable delayed delivery for messages on a namespace
           "tickTime" : 1000, // The tick time for when retrying on delayed delivery messages
       }
       
       
      Parameters:
      namespace - Namespace name
      Returns:
      delayedDeliveryPolicies Whether to enable the delayed delivery for messages.
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getDelayedDeliveryAsync

      CompletableFuture<DelayedDeliveryPolicies> getDelayedDeliveryAsync(String namespace)
      Get the delayed delivery messages for all topics within a namespace asynchronously.

      If disabled, messages will be immediately delivered and there will be no tracking overhead.

      Request example:

       
       {
           "active" : true,   // Enable or disable delayed delivery for messages on a namespace
           "tickTime" : 1000, // The tick time for when retrying on delayed delivery messages
       }
       
       
      Parameters:
      namespace - Namespace name
      Returns:
      delayedDeliveryPolicies Whether to enable the delayed delivery for messages.
    • setDelayedDeliveryMessages

      void setDelayedDeliveryMessages(String namespace, DelayedDeliveryPolicies delayedDeliveryPolicies) throws PulsarAdminException
      Set the delayed delivery messages for all topics within a namespace.

      If disabled, messages will be immediately delivered and there will be no tracking overhead.

      Request example:

       
       {
           "tickTime" : 1000, // Enable or disable delayed delivery for messages on a namespace
           "active" : true,   // The tick time for when retrying on delayed delivery messages
       }
       
       
      Parameters:
      namespace - Namespace name
      delayedDeliveryPolicies - Whether to enable the delayed delivery for messages.
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setDelayedDeliveryMessagesAsync

      CompletableFuture<Void> setDelayedDeliveryMessagesAsync(String namespace, DelayedDeliveryPolicies delayedDeliveryPolicies)
      Set the delayed delivery messages for all topics within a namespace asynchronously.

      If disabled, messages will be immediately delivered and there will be no tracking overhead.

      Request example:

       
       {
           "tickTime" : 1000, // Enable or disable delayed delivery for messages on a namespace
           "active" : true,   // The tick time for when retrying on delayed delivery messages
       }
       
       
      Parameters:
      namespace - Namespace name
      delayedDeliveryPolicies - Whether to enable the delayed delivery for messages.
    • removeDelayedDeliveryMessages

      void removeDelayedDeliveryMessages(String namespace) throws PulsarAdminException
      Remove the delayed delivery messages for all topics within a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeDelayedDeliveryMessagesAsync

      CompletableFuture<Void> removeDelayedDeliveryMessagesAsync(String namespace)
      Remove the delayed delivery messages for all topics within a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getInactiveTopicPolicies

      InactiveTopicPolicies getInactiveTopicPolicies(String namespace) throws PulsarAdminException
      Get the inactive deletion strategy for all topics within a namespace synchronously.
      Parameters:
      namespace -
      Returns:
      Throws:
      PulsarAdminException
    • removeInactiveTopicPoliciesAsync

      CompletableFuture<Void> removeInactiveTopicPoliciesAsync(String namespace)
      remove InactiveTopicPolicies from a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • removeInactiveTopicPolicies

      void removeInactiveTopicPolicies(String namespace) throws PulsarAdminException
      Remove inactive topic policies from a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • getInactiveTopicPoliciesAsync

      CompletableFuture<InactiveTopicPolicies> getInactiveTopicPoliciesAsync(String namespace)
      Get the inactive deletion strategy for all topics within a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • setInactiveTopicPolicies

      void setInactiveTopicPolicies(String namespace, InactiveTopicPolicies inactiveTopicPolicies) throws PulsarAdminException
      As same as setInactiveTopicPoliciesAsync, but it is synchronous.
      Parameters:
      namespace -
      inactiveTopicPolicies -
      Throws:
      PulsarAdminException
    • setInactiveTopicPoliciesAsync

      CompletableFuture<Void> setInactiveTopicPoliciesAsync(String namespace, InactiveTopicPolicies inactiveTopicPolicies)
      You can set the inactive deletion strategy at the namespace level. Its priority is higher than the inactive deletion strategy at the broker level. All topics under this namespace will follow this strategy.
      Parameters:
      namespace -
      inactiveTopicPolicies -
      Returns:
    • setSubscriptionAuthMode

      void setSubscriptionAuthMode(String namespace, SubscriptionAuthMode subscriptionAuthMode) throws PulsarAdminException
      Set the given subscription auth mode on all topics on a namespace.
      Parameters:
      namespace -
      subscriptionAuthMode -
      Throws:
      PulsarAdminException
    • setSubscriptionAuthModeAsync

      CompletableFuture<Void> setSubscriptionAuthModeAsync(String namespace, SubscriptionAuthMode subscriptionAuthMode)
      Set the given subscription auth mode on all topics on a namespace asynchronously.
      Parameters:
      namespace -
      subscriptionAuthMode -
    • getSubscriptionAuthMode

      SubscriptionAuthMode getSubscriptionAuthMode(String namespace) throws PulsarAdminException
      Get the subscriptionAuthMode within a namespace.
      Parameters:
      namespace -
      Returns:
      Throws:
      PulsarAdminException
    • getSubscriptionAuthModeAsync

      CompletableFuture<SubscriptionAuthMode> getSubscriptionAuthModeAsync(String namespace)
      Get the subscriptionAuthMode within a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getDeduplicationSnapshotInterval

      Integer getDeduplicationSnapshotInterval(String namespace) throws PulsarAdminException
      Get the deduplicationSnapshotInterval for a namespace.
      Parameters:
      namespace -
      Returns:
      Throws:
      PulsarAdminException
    • getDeduplicationSnapshotIntervalAsync

      CompletableFuture<Integer> getDeduplicationSnapshotIntervalAsync(String namespace)
      Get the deduplicationSnapshotInterval for a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • setDeduplicationSnapshotInterval

      void setDeduplicationSnapshotInterval(String namespace, Integer interval) throws PulsarAdminException
      Set the deduplicationSnapshotInterval for a namespace.
      Parameters:
      namespace -
      interval -
      Throws:
      PulsarAdminException
    • setDeduplicationSnapshotIntervalAsync

      CompletableFuture<Void> setDeduplicationSnapshotIntervalAsync(String namespace, Integer interval)
      Set the deduplicationSnapshotInterval for a namespace asynchronously.
      Parameters:
      namespace -
      interval -
      Returns:
    • removeDeduplicationSnapshotInterval

      void removeDeduplicationSnapshotInterval(String namespace) throws PulsarAdminException
      Remove the deduplicationSnapshotInterval for a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeDeduplicationSnapshotIntervalAsync

      CompletableFuture<Void> removeDeduplicationSnapshotIntervalAsync(String namespace)
      Remove the deduplicationSnapshotInterval for a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getMaxSubscriptionsPerTopic

      Integer getMaxSubscriptionsPerTopic(String namespace) throws PulsarAdminException
      Get the maxSubscriptionsPerTopic for a namespace.
      Parameters:
      namespace -
      Returns:
      Throws:
      PulsarAdminException
    • getMaxSubscriptionsPerTopicAsync

      CompletableFuture<Integer> getMaxSubscriptionsPerTopicAsync(String namespace)
      Get the maxSubscriptionsPerTopic for a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • setMaxSubscriptionsPerTopic

      void setMaxSubscriptionsPerTopic(String namespace, int maxSubscriptionsPerTopic) throws PulsarAdminException
      Set the maxSubscriptionsPerTopic for a namespace.
      Parameters:
      namespace -
      maxSubscriptionsPerTopic -
      Throws:
      PulsarAdminException
    • setMaxSubscriptionsPerTopicAsync

      CompletableFuture<Void> setMaxSubscriptionsPerTopicAsync(String namespace, int maxSubscriptionsPerTopic)
      Set the maxSubscriptionsPerTopic for a namespace asynchronously.
      Parameters:
      namespace -
      maxSubscriptionsPerTopic -
      Returns:
    • removeMaxSubscriptionsPerTopic

      void removeMaxSubscriptionsPerTopic(String namespace) throws PulsarAdminException
      Remove the maxSubscriptionsPerTopic for a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeMaxSubscriptionsPerTopicAsync

      CompletableFuture<Void> removeMaxSubscriptionsPerTopicAsync(String namespace)
      Remove the maxSubscriptionsPerTopic for a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getMaxProducersPerTopic

      Integer getMaxProducersPerTopic(String namespace) throws PulsarAdminException
      Get the maxProducersPerTopic for a namespace.

      Response example:

       0
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getMaxProducersPerTopicAsync

      CompletableFuture<Integer> getMaxProducersPerTopicAsync(String namespace)
      Get the maxProducersPerTopic for a namespace asynchronously.

      Response example:

       0
       
      Parameters:
      namespace - Namespace name
    • setMaxProducersPerTopic

      void setMaxProducersPerTopic(String namespace, int maxProducersPerTopic) throws PulsarAdminException
      Set maxProducersPerTopic for a namespace.

      Request example:

       10
       
      Parameters:
      namespace - Namespace name
      maxProducersPerTopic - maxProducersPerTopic value for a namespace
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setMaxProducersPerTopicAsync

      CompletableFuture<Void> setMaxProducersPerTopicAsync(String namespace, int maxProducersPerTopic)
      Set maxProducersPerTopic for a namespace asynchronously.

      Request example:

       10
       
      Parameters:
      namespace - Namespace name
      maxProducersPerTopic - maxProducersPerTopic value for a namespace
    • removeMaxProducersPerTopic

      void removeMaxProducersPerTopic(String namespace) throws PulsarAdminException
      Remove maxProducersPerTopic for a namespace.
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • removeMaxProducersPerTopicAsync

      CompletableFuture<Void> removeMaxProducersPerTopicAsync(String namespace)
      Set maxProducersPerTopic for a namespace asynchronously.
      Parameters:
      namespace - Namespace name
    • getMaxConsumersPerTopic

      Integer getMaxConsumersPerTopic(String namespace) throws PulsarAdminException
      Get the maxProducersPerTopic for a namespace.

      Response example:

       0
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getMaxConsumersPerTopicAsync

      CompletableFuture<Integer> getMaxConsumersPerTopicAsync(String namespace)
      Get the maxProducersPerTopic for a namespace asynchronously.

      Response example:

       0
       
      Parameters:
      namespace - Namespace name
    • setMaxConsumersPerTopic

      void setMaxConsumersPerTopic(String namespace, int maxConsumersPerTopic) throws PulsarAdminException
      Set maxConsumersPerTopic for a namespace.

      Request example:

       10
       
      Parameters:
      namespace - Namespace name
      maxConsumersPerTopic - maxConsumersPerTopic value for a namespace
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setMaxConsumersPerTopicAsync

      CompletableFuture<Void> setMaxConsumersPerTopicAsync(String namespace, int maxConsumersPerTopic)
      Set maxConsumersPerTopic for a namespace asynchronously.

      Request example:

       10
       
      Parameters:
      namespace - Namespace name
      maxConsumersPerTopic - maxConsumersPerTopic value for a namespace
    • removeMaxConsumersPerTopic

      void removeMaxConsumersPerTopic(String namespace) throws PulsarAdminException
      Remove maxConsumersPerTopic for a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeMaxConsumersPerTopicAsync

      CompletableFuture<Void> removeMaxConsumersPerTopicAsync(String namespace)
      Remove maxConsumersPerTopic for a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getMaxConsumersPerSubscription

      Integer getMaxConsumersPerSubscription(String namespace) throws PulsarAdminException
      Get the maxConsumersPerSubscription for a namespace.

      Response example:

       0
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getMaxConsumersPerSubscriptionAsync

      CompletableFuture<Integer> getMaxConsumersPerSubscriptionAsync(String namespace)
      Get the maxConsumersPerSubscription for a namespace asynchronously.

      Response example:

       0
       
      Parameters:
      namespace - Namespace name
    • setMaxConsumersPerSubscription

      void setMaxConsumersPerSubscription(String namespace, int maxConsumersPerSubscription) throws PulsarAdminException
      Set maxConsumersPerSubscription for a namespace.

      Request example:

       10
       
      Parameters:
      namespace - Namespace name
      maxConsumersPerSubscription - maxConsumersPerSubscription value for a namespace
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setMaxConsumersPerSubscriptionAsync

      CompletableFuture<Void> setMaxConsumersPerSubscriptionAsync(String namespace, int maxConsumersPerSubscription)
      Set maxConsumersPerSubscription for a namespace asynchronously.

      Request example:

       10
       
      Parameters:
      namespace - Namespace name
      maxConsumersPerSubscription - maxConsumersPerSubscription value for a namespace
    • removeMaxConsumersPerSubscription

      void removeMaxConsumersPerSubscription(String namespace) throws PulsarAdminException
      Remove maxConsumersPerSubscription for a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeMaxConsumersPerSubscriptionAsync

      CompletableFuture<Void> removeMaxConsumersPerSubscriptionAsync(String namespace)
      Remove maxConsumersPerSubscription for a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getMaxUnackedMessagesPerConsumer

      Integer getMaxUnackedMessagesPerConsumer(String namespace) throws PulsarAdminException
      Get the maxUnackedMessagesPerConsumer for a namespace.

      Response example:

       0
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getMaxUnackedMessagesPerConsumerAsync

      CompletableFuture<Integer> getMaxUnackedMessagesPerConsumerAsync(String namespace)
      Get the maxUnackedMessagesPerConsumer for a namespace asynchronously.

      Response example:

       0
       
      Parameters:
      namespace - Namespace name
    • setMaxUnackedMessagesPerConsumer

      void setMaxUnackedMessagesPerConsumer(String namespace, int maxUnackedMessagesPerConsumer) throws PulsarAdminException
      Set maxUnackedMessagesPerConsumer for a namespace.

      Request example:

       10
       
      Parameters:
      namespace - Namespace name
      maxUnackedMessagesPerConsumer - maxUnackedMessagesPerConsumer value for a namespace
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setMaxUnackedMessagesPerConsumerAsync

      CompletableFuture<Void> setMaxUnackedMessagesPerConsumerAsync(String namespace, int maxUnackedMessagesPerConsumer)
      Set maxUnackedMessagesPerConsumer for a namespace asynchronously.

      Request example:

       10
       
      Parameters:
      namespace - Namespace name
      maxUnackedMessagesPerConsumer - maxUnackedMessagesPerConsumer value for a namespace
    • removeMaxUnackedMessagesPerConsumer

      void removeMaxUnackedMessagesPerConsumer(String namespace) throws PulsarAdminException
      Remove maxUnackedMessagesPerConsumer for a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeMaxUnackedMessagesPerConsumerAsync

      CompletableFuture<Void> removeMaxUnackedMessagesPerConsumerAsync(String namespace)
      Remove maxUnackedMessagesPerConsumer for a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getMaxUnackedMessagesPerSubscription

      Integer getMaxUnackedMessagesPerSubscription(String namespace) throws PulsarAdminException
      Get the maxUnackedMessagesPerSubscription for a namespace.

      Response example:

       0
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getMaxUnackedMessagesPerSubscriptionAsync

      CompletableFuture<Integer> getMaxUnackedMessagesPerSubscriptionAsync(String namespace)
      Get the maxUnackedMessagesPerSubscription for a namespace asynchronously.

      Response example:

       0
       
      Parameters:
      namespace - Namespace name
    • setMaxUnackedMessagesPerSubscription

      void setMaxUnackedMessagesPerSubscription(String namespace, int maxUnackedMessagesPerSubscription) throws PulsarAdminException
      Set maxUnackedMessagesPerSubscription for a namespace.

      Request example:

       10
       
      Parameters:
      namespace - Namespace name
      maxUnackedMessagesPerSubscription - Max number of unacknowledged messages allowed per shared subscription.
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setMaxUnackedMessagesPerSubscriptionAsync

      CompletableFuture<Void> setMaxUnackedMessagesPerSubscriptionAsync(String namespace, int maxUnackedMessagesPerSubscription)
      Set maxUnackedMessagesPerSubscription for a namespace asynchronously.

      Request example:

       10
       
      Parameters:
      namespace - Namespace name
      maxUnackedMessagesPerSubscription - Max number of unacknowledged messages allowed per shared subscription.
    • removeMaxUnackedMessagesPerSubscription

      void removeMaxUnackedMessagesPerSubscription(String namespace) throws PulsarAdminException
      Remove maxUnackedMessagesPerSubscription for a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeMaxUnackedMessagesPerSubscriptionAsync

      CompletableFuture<Void> removeMaxUnackedMessagesPerSubscriptionAsync(String namespace)
      Remove maxUnackedMessagesPerSubscription for a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getCompactionThreshold

      Long getCompactionThreshold(String namespace) throws PulsarAdminException
      Get the compactionThreshold for a namespace. The maximum number of bytes topics in the namespace can have before compaction is triggered. 0 disables.

      Response example:

       10000000
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getCompactionThresholdAsync

      CompletableFuture<Long> getCompactionThresholdAsync(String namespace)
      Get the compactionThreshold for a namespace asynchronously. The maximum number of bytes topics in the namespace can have before compaction is triggered. 0 disables.

      Response example:

       10000000
       
      Parameters:
      namespace - Namespace name
    • setCompactionThreshold

      void setCompactionThreshold(String namespace, long compactionThreshold) throws PulsarAdminException
      Set the compactionThreshold for a namespace. The maximum number of bytes topics in the namespace can have before compaction is triggered. 0 disables.

      Request example:

       10000000
       
      Parameters:
      namespace - Namespace name
      compactionThreshold - maximum number of backlog bytes before compaction is triggered
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setCompactionThresholdAsync

      CompletableFuture<Void> setCompactionThresholdAsync(String namespace, long compactionThreshold)
      Set the compactionThreshold for a namespace asynchronously. The maximum number of bytes topics in the namespace can have before compaction is triggered. 0 disables.

      Request example:

       10000000
       
      Parameters:
      namespace - Namespace name
      compactionThreshold - maximum number of backlog bytes before compaction is triggered
    • removeCompactionThreshold

      void removeCompactionThreshold(String namespace) throws PulsarAdminException
      Delete the compactionThreshold for a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeCompactionThresholdAsync

      CompletableFuture<Void> removeCompactionThresholdAsync(String namespace)
      Delete the compactionThreshold for a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getOffloadThreshold

      long getOffloadThreshold(String namespace) throws PulsarAdminException
      Get the offloadThreshold for a namespace. The maximum number of bytes stored on the pulsar cluster for topics in the namespace before data starts being offloaded to longterm storage.

      Response example:

       10000000
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getOffloadThresholdAsync

      CompletableFuture<Long> getOffloadThresholdAsync(String namespace)
      Get the offloadThreshold for a namespace asynchronously.

      The maximum number of bytes stored on the pulsar cluster for topics in the namespace before data starts being offloaded to longterm storage.

      Response example:

       10000000
       
      Parameters:
      namespace - Namespace name
    • getOffloadThresholdInSeconds

      long getOffloadThresholdInSeconds(String namespace) throws PulsarAdminException
      Get the offloadThresholdInSeconds for a namespace.

      Response example:

       10000000
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getOffloadThresholdInSecondsAsync

      CompletableFuture<Long> getOffloadThresholdInSecondsAsync(String namespace)
      Get the offloadThresholdInSeconds for a namespace.

      Response example:

       10000000
       
      Parameters:
      namespace - Namespace name
    • setOffloadThreshold

      void setOffloadThreshold(String namespace, long offloadThreshold) throws PulsarAdminException
      Set the offloadThreshold for a namespace.

      The maximum number of bytes stored on the pulsar cluster for topics in the namespace before data starts being offloaded to longterm storage.

      Negative values disabled automatic offloading. Setting a threshold of 0 will offload data as soon as possible.

      Request example:

       10000000
       
      Parameters:
      namespace - Namespace name
      offloadThreshold - maximum number of bytes stored before offloading is triggered
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setOffloadThresholdAsync

      CompletableFuture<Void> setOffloadThresholdAsync(String namespace, long offloadThreshold)
      Set the offloadThreshold for a namespace asynchronously.

      The maximum number of bytes stored on the pulsar cluster for topics in the namespace before data starts being offloaded to longterm storage.

      Negative values disabled automatic offloading. Setting a threshold of 0 will offload data as soon as possible.

      Request example:

       10000000
       
      Parameters:
      namespace - Namespace name
      offloadThreshold - maximum number of bytes stored before offloading is triggered
    • setOffloadThresholdInSeconds

      void setOffloadThresholdInSeconds(String namespace, long offloadThresholdInSeconds) throws PulsarAdminException
      Set the offloadThresholdInSeconds for a namespace.

      Negative values disabled automatic offloading. Setting a threshold of 0 will offload data as soon as possible.

      Request example:

       10000000
       
      Parameters:
      namespace - Namespace name
      offloadThresholdInSeconds - maximum number of bytes stored before offloading is triggered
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setOffloadThresholdInSecondsAsync

      CompletableFuture<Void> setOffloadThresholdInSecondsAsync(String namespace, long offloadThresholdInSeconds)
      Set the offloadThresholdInSeconds for a namespace.

      Negative values disabled automatic offloading. Setting a threshold of 0 will offload data as soon as possible.

      Request example:

       10000000
       
      Parameters:
      namespace - Namespace name
      offloadThresholdInSeconds - maximum number of seconds stored before offloading is triggered
    • getOffloadDeleteLagMs

      Long getOffloadDeleteLagMs(String namespace) throws PulsarAdminException
      Get the offload deletion lag for a namespace, in milliseconds. The number of milliseconds to wait before deleting a ledger segment which has been offloaded from the Pulsar cluster's local storage (i.e. BookKeeper).

      If the offload deletion lag has not been set for the namespace, the method returns 'null' and the namespace will use the configured default of the pulsar broker.

      A negative value disables deletion of the local ledger completely, though it will still be deleted if it exceeds the topics retention policy, along with the offloaded copy.

      Response example:

       3600000
       
      Parameters:
      namespace - Namespace name
      Returns:
      the offload deletion lag for the namespace in milliseconds, or null if not set
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getOffloadDeleteLagMsAsync

      CompletableFuture<Long> getOffloadDeleteLagMsAsync(String namespace)
      Get the offload deletion lag asynchronously for a namespace, in milliseconds.

      The number of milliseconds to wait before deleting a ledger segment which has been offloaded from the Pulsar cluster's local storage (i.e. BookKeeper).

      If the offload deletion lag has not been set for the namespace, the method returns 'null' and the namespace will use the configured default of the pulsar broker.

      A negative value disables deletion of the local ledger completely, though it will still be deleted if it exceeds the topics retention policy, along with the offloaded copy.

      Response example:

       3600000
       
      Parameters:
      namespace - Namespace name
      Returns:
      the offload deletion lag for the namespace in milliseconds, or null if not set
    • setOffloadDeleteLag

      void setOffloadDeleteLag(String namespace, long lag, TimeUnit unit) throws PulsarAdminException
      Set the offload deletion lag for a namespace.

      The offload deletion lag is the amount of time to wait after offloading a ledger segment to long term storage, before deleting its copy stored on the Pulsar cluster's local storage (i.e. BookKeeper).

      A negative value disables deletion of the local ledger completely, though it will still be deleted if it exceeds the topics retention policy, along with the offloaded copy.

      Parameters:
      namespace - Namespace name
      lag - the duration to wait before deleting the local copy
      unit - the timeunit of the duration
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setOffloadDeleteLagAsync

      CompletableFuture<Void> setOffloadDeleteLagAsync(String namespace, long lag, TimeUnit unit)
      Set the offload deletion lag for a namespace asynchronously.

      The offload deletion lag is the amount of time to wait after offloading a ledger segment to long term storage, before deleting its copy stored on the Pulsar cluster's local storage (i.e. BookKeeper).

      A negative value disables deletion of the local ledger completely, though it will still be deleted if it exceeds the topics retention policy, along with the offloaded copy.

      Parameters:
      namespace - Namespace name
      lag - the duration to wait before deleting the local copy
      unit - the timeunit of the duration
    • clearOffloadDeleteLag

      void clearOffloadDeleteLag(String namespace) throws PulsarAdminException
      Clear the offload deletion lag for a namespace.

      The namespace will fall back to using the configured default of the pulsar broker.

      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • clearOffloadDeleteLagAsync

      CompletableFuture<Void> clearOffloadDeleteLagAsync(String namespace)
      Clear the offload deletion lag for a namespace asynchronously.

      The namespace will fall back to using the configured default of the pulsar broker.

    • getSchemaAutoUpdateCompatibilityStrategy

      @Deprecated SchemaAutoUpdateCompatibilityStrategy getSchemaAutoUpdateCompatibilityStrategy(String namespace) throws PulsarAdminException
      Deprecated.
      Get the strategy used to check the a new schema provided by a producer is compatible with the current schema before it is installed.

      If this is SchemaAutoUpdateCompatibilityStrategy.AutoUpdateDisabled, then all new schemas provided via the producer are rejected, and schemas must be updated through the REST api.

      Parameters:
      namespace - The namespace in whose policy we are interested
      Returns:
      the strategy used to check compatibility
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setSchemaAutoUpdateCompatibilityStrategy

      @Deprecated void setSchemaAutoUpdateCompatibilityStrategy(String namespace, SchemaAutoUpdateCompatibilityStrategy strategy) throws PulsarAdminException
      Deprecated.
      Set the strategy used to check the a new schema provided by a producer is compatible with the current schema before it is installed.

      To disable all new schema updates through the producer, set this to SchemaAutoUpdateCompatibilityStrategy.AutoUpdateDisabled.

      Parameters:
      namespace - The namespace in whose policy should be set
      strategy -
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getSchemaValidationEnforced

      boolean getSchemaValidationEnforced(String namespace) throws PulsarAdminException
      Get schema validation enforced for namespace.
      Parameters:
      namespace - namespace for this command.
      Returns:
      the schema validation enforced flag
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Tenant or Namespace does not exist
      PulsarAdminException - Unexpected error
    • getSchemaValidationEnforcedAsync

      CompletableFuture<Boolean> getSchemaValidationEnforcedAsync(String namespace)
      Get schema validation enforced for namespace asynchronously.
      Parameters:
      namespace - namespace for this command.
      Returns:
      the schema validation enforced flag
    • getSchemaValidationEnforced

      boolean getSchemaValidationEnforced(String namespace, boolean applied) throws PulsarAdminException
      Get schema validation enforced for namespace.
      Parameters:
      namespace - namespace for this command.
      applied - applied for this command.
      Returns:
      the schema validation enforced flag
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Tenant or Namespace does not exist
      PulsarAdminException - Unexpected error
    • getSchemaValidationEnforcedAsync

      CompletableFuture<Boolean> getSchemaValidationEnforcedAsync(String namespace, boolean applied)
      Get schema validation enforced for namespace asynchronously.
      Parameters:
      namespace - namespace for this command.
      applied - applied for this command.
      Returns:
      the schema validation enforced flag
    • setSchemaValidationEnforced

      void setSchemaValidationEnforced(String namespace, boolean schemaValidationEnforced) throws PulsarAdminException
      Set schema validation enforced for namespace. if a producer without a schema attempts to produce to a topic with schema in this the namespace, the producer will be failed to connect. PLEASE be carefully on using this, since non-java clients don't support schema. if you enable this setting, it will cause non-java clients failed to produce.
      Parameters:
      namespace - pulsar namespace name
      schemaValidationEnforced - flag to enable or disable schema validation for the given namespace
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Tenant or Namespace does not exist
      PulsarAdminException - Unexpected error
    • setSchemaValidationEnforcedAsync

      CompletableFuture<Void> setSchemaValidationEnforcedAsync(String namespace, boolean schemaValidationEnforced)
      Set schema validation enforced for namespace asynchronously. if a producer without a schema attempts to produce to a topic with schema in this the namespace, the producer will be failed to connect. PLEASE be carefully on using this, since non-java clients don't support schema. if you enable this setting, it will cause non-java clients failed to produce.
      Parameters:
      namespace - pulsar namespace name
      schemaValidationEnforced - flag to enable or disable schema validation for the given namespace
    • getSchemaCompatibilityStrategy

      SchemaCompatibilityStrategy getSchemaCompatibilityStrategy(String namespace) throws PulsarAdminException
      Get the strategy used to check the a new schema provided by a producer is compatible with the current schema before it is installed.
      Parameters:
      namespace - The namespace in whose policy we are interested
      Returns:
      the strategy used to check compatibility
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getSchemaCompatibilityStrategyAsync

      CompletableFuture<SchemaCompatibilityStrategy> getSchemaCompatibilityStrategyAsync(String namespace)
      Get the strategy used to check the a new schema provided by a producer is compatible with the current schema before it is installed asynchronously.
      Parameters:
      namespace - The namespace in whose policy we are interested
      Returns:
      the strategy used to check compatibility
    • setSchemaCompatibilityStrategy

      void setSchemaCompatibilityStrategy(String namespace, SchemaCompatibilityStrategy strategy) throws PulsarAdminException
      Set the strategy used to check the a new schema provided by a producer is compatible with the current schema before it is installed.
      Parameters:
      namespace - The namespace in whose policy should be set
      strategy - The schema compatibility strategy
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setSchemaCompatibilityStrategyAsync

      CompletableFuture<Void> setSchemaCompatibilityStrategyAsync(String namespace, SchemaCompatibilityStrategy strategy)
      Set the strategy used to check the a new schema provided by a producer is compatible with the current schema before it is installed asynchronously.
      Parameters:
      namespace - The namespace in whose policy should be set
      strategy - The schema compatibility strategy
    • getIsAllowAutoUpdateSchema

      boolean getIsAllowAutoUpdateSchema(String namespace) throws PulsarAdminException
      Get whether allow auto update schema.
      Parameters:
      namespace - pulsar namespace name
      Returns:
      the schema validation enforced flag
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Tenant or Namespace does not exist
      PulsarAdminException - Unexpected error
    • getIsAllowAutoUpdateSchemaAsync

      CompletableFuture<Boolean> getIsAllowAutoUpdateSchemaAsync(String namespace)
      Get whether allow auto update schema asynchronously.
      Parameters:
      namespace - pulsar namespace name
      Returns:
      the schema validation enforced flag
    • setIsAllowAutoUpdateSchema

      void setIsAllowAutoUpdateSchema(String namespace, boolean isAllowAutoUpdateSchema) throws PulsarAdminException
      Set whether to allow automatic schema updates.

      The flag is when producer bring a new schema and the schema pass compatibility check whether allow schema auto registered

      Parameters:
      namespace - pulsar namespace name
      isAllowAutoUpdateSchema - flag to enable or disable auto update schema
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Tenant or Namespace does not exist
      PulsarAdminException - Unexpected error
    • setIsAllowAutoUpdateSchemaAsync

      CompletableFuture<Void> setIsAllowAutoUpdateSchemaAsync(String namespace, boolean isAllowAutoUpdateSchema)
      Set whether to allow automatic schema updates asynchronously.

      The flag is when producer bring a new schema and the schema pass compatibility check whether allow schema auto registered

      Parameters:
      namespace - pulsar namespace name
      isAllowAutoUpdateSchema - flag to enable or disable auto update schema
    • setOffloadPolicies

      void setOffloadPolicies(String namespace, OffloadPolicies offloadPolicies) throws PulsarAdminException
      Set the offload configuration for all the topics in a namespace.

      Set the offload configuration in a namespace. This operation requires pulsar tenant access.

      Request parameter example:

       
       {
           "region" : "us-east-2",                   // The long term storage region
           "bucket" : "bucket",                      // Bucket to place offloaded ledger into
           "endpoint" : "endpoint",                  // Alternative endpoint to connect to
           "maxBlockSize" : 1024,                    // Max Block Size, default 64MB
           "readBufferSize" : 1024,                  // Read Buffer Size, default 1MB
       }
       
       
      Parameters:
      namespace - Namespace name
      offloadPolicies - Offload configuration
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.ConflictException - Concurrent modification
      PulsarAdminException - Unexpected error
    • removeOffloadPolicies

      void removeOffloadPolicies(String namespace) throws PulsarAdminException
      Remove the offload configuration for a namespace.

      Remove the offload configuration in a namespace. This operation requires pulsar tenant access.

      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.ConflictException - Concurrent modification
      PulsarAdminException - Unexpected error
    • setOffloadPoliciesAsync

      CompletableFuture<Void> setOffloadPoliciesAsync(String namespace, OffloadPolicies offloadPolicies)
      Set the offload configuration for all the topics in a namespace asynchronously.

      Set the offload configuration in a namespace. This operation requires pulsar tenant access.

      Request parameter example:

       
       {
           "region" : "us-east-2",                   // The long term storage region
           "bucket" : "bucket",                      // Bucket to place offloaded ledger into
           "endpoint" : "endpoint",                  // Alternative endpoint to connect to
           "maxBlockSize" : 1024,                    // Max Block Size, default 64MB
           "readBufferSize" : 1024,                  // Read Buffer Size, default 1MB
       }
       
       
      Parameters:
      namespace - Namespace name
      offloadPolicies - Offload configuration
    • removeOffloadPoliciesAsync

      CompletableFuture<Void> removeOffloadPoliciesAsync(String namespace)
      Remove the offload configuration for a namespace asynchronously.

      Remove the offload configuration in a namespace. This operation requires pulsar tenant access.

      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.ConflictException - Concurrent modification
      PulsarAdminException - Unexpected error
    • getOffloadPolicies

      OffloadPolicies getOffloadPolicies(String namespace) throws PulsarAdminException
      Get the offload configuration for a namespace.

      Get the offload configuration for a namespace.

      Response example:

       
       {
           "region" : "us-east-2",                   // The long term storage region
           "bucket" : "bucket",                      // Bucket to place offloaded ledger into
           "endpoint" : "endpoint",                  // Alternative endpoint to connect to
           "maxBlockSize" : 1024,                    // Max Block Size, default 64MB
           "readBufferSize" : 1024,                  // Read Buffer Size, default 1MB
       }
       
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException.ConflictException - Concurrent modification
      PulsarAdminException - Unexpected error
    • getOffloadPoliciesAsync

      CompletableFuture<OffloadPolicies> getOffloadPoliciesAsync(String namespace)
      Get the offload configuration for a namespace asynchronously.

      Get the offload configuration for a namespace.

      Response example:

       
       {
           "region" : "us-east-2",                   // The long term storage region
           "bucket" : "bucket",                      // Bucket to place offloaded ledger into
           "endpoint" : "endpoint",                  // Alternative endpoint to connect to
           "maxBlockSize" : 1024,                    // Max Block Size, default 64MB
           "readBufferSize" : 1024,                  // Read Buffer Size, default 1MB
       }
       
       
      Parameters:
      namespace - Namespace name
    • getMaxTopicsPerNamespace

      int getMaxTopicsPerNamespace(String namespace) throws PulsarAdminException
      Get maxTopicsPerNamespace for a namespace.

      Response example:

           0
       
      Parameters:
      namespace - Namespace name
      Returns:
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace dost not exist
      PulsarAdminException - Unexpected error
    • getMaxTopicsPerNamespaceAsync

      CompletableFuture<Integer> getMaxTopicsPerNamespaceAsync(String namespace)
      Get maxTopicsPerNamespace for a namespace asynchronously.

      Response example:

           0
       
      Parameters:
      namespace - Namespace name
      Returns:
    • setMaxTopicsPerNamespace

      void setMaxTopicsPerNamespace(String namespace, int maxTopicsPerNamespace) throws PulsarAdminException
      Set maxTopicsPerNamespace for a namespace.

      Request example:

           100
       
      Parameters:
      namespace - Namespace name
      maxTopicsPerNamespace - maxTopicsPerNamespace value for a namespace
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setMaxTopicsPerNamespaceAsync

      CompletableFuture<Void> setMaxTopicsPerNamespaceAsync(String namespace, int maxTopicsPerNamespace)
      Set maxTopicsPerNamespace for a namespace asynchronously.

      Request example:

           100
       
      Parameters:
      namespace - Namespace name
      maxTopicsPerNamespace - maxTopicsPerNamespace value for a namespace
      Returns:
    • removeMaxTopicsPerNamespace

      void removeMaxTopicsPerNamespace(String namespace) throws PulsarAdminException
      remove maxTopicsPerNamespace for a namespace.
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • removeMaxTopicsPerNamespaceAsync

      CompletableFuture<Void> removeMaxTopicsPerNamespaceAsync(String namespace)
      remove maxTopicsPerNamespace for a namespace asynchronously.
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setPropertyAsync

      CompletableFuture<Void> setPropertyAsync(String namespace, String key, String value)
      Set key value pair property for a namespace. If the property absents, a new property will added. Otherwise, the new value will overwrite.

      Example:

           admin.namespaces().setProperty("a", "a");
           admin.namespaces().setProperty("b", "b");
       
      Parameters:
      namespace - Namespace name
      key - key of the property
      value - value of the property
    • setProperty

      void setProperty(String namespace, String key, String value) throws PulsarAdminException
      Set key value pair property for a namespace. If the property absents, a new property will added. Otherwise, the new value will overwrite.

      Example:

           admin.namespaces().setProperty("a", "a");
           admin.namespaces().setProperty("b", "b");
       
      Parameters:
      namespace - Namespace name
      key - key of the property
      value - value of the property
      Throws:
      PulsarAdminException
    • setPropertiesAsync

      CompletableFuture<Void> setPropertiesAsync(String namespace, Map<String,String> properties)
      Set key value pair properties for a namespace asynchronously. If the property absents, a new property will added. Otherwise, the new value will overwrite.
      Parameters:
      namespace - Namespace name
      properties - key value pair properties
    • setProperties

      void setProperties(String namespace, Map<String,String> properties) throws PulsarAdminException
      Set key value pair properties for a namespace. If the property absents, a new property will added. Otherwise, the new value will overwrite.
      Parameters:
      namespace - Namespace name
      properties - key value pair properties
      Throws:
      PulsarAdminException
    • getPropertyAsync

      CompletableFuture<String> getPropertyAsync(String namespace, String key)
      Get property value for a given key. If the property absents, will return null.

      Example:

           admin.namespaces().getProperty("a");
           admin.namespaces().getProperty("b");
       
      Parameters:
      namespace - Namespace name
      key - key of the property
      Returns:
      value of the property.
    • getProperty

      String getProperty(String namespace, String key) throws PulsarAdminException
      Get property value for a given key. If the property absents, will return null.

      Example:

           admin.namespaces().getProperty("a");
           admin.namespaces().getProperty("b");
       
      Parameters:
      namespace - Namespace name
      key - key of the property
      Returns:
      value of the property.
      Throws:
      PulsarAdminException
    • getPropertiesAsync

      CompletableFuture<Map<String,String>> getPropertiesAsync(String namespace)
      Get all properties of a namespace asynchronously.

      Example:

           admin.namespaces().getPropertiesAsync();
       
      Parameters:
      namespace - Namespace name
      Returns:
      key value pair properties.
    • getProperties

      Map<String,String> getProperties(String namespace) throws PulsarAdminException
      Get all properties of a namespace.

      Example:

           admin.namespaces().getProperties();
       
      Parameters:
      namespace - Namespace name
      Returns:
      key value pair properties.
      Throws:
      PulsarAdminException
    • removePropertyAsync

      CompletableFuture<String> removePropertyAsync(String namespace, String key)
      Remove a property for a given key. Return value of the property if the property exists, otherwise return null.

      Example:

           admin.namespaces().removeProperty("a");
           admin.namespaces().removeProperty("b");
       
      Parameters:
      namespace - Namespace name
      key - key of the property
      Returns:
      value of the property.
    • removeProperty

      String removeProperty(String namespace, String key) throws PulsarAdminException
      Remove a property for a given key. Return value of the property if the property exists, otherwise return null.

      Example:

           admin.namespaces().removeProperty("a");
           admin.namespaces().removeProperty("b");
       
      Parameters:
      namespace - Namespace name
      key - key of the property
      Returns:
      value of the property.
      Throws:
      PulsarAdminException
    • clearPropertiesAsync

      CompletableFuture<Void> clearPropertiesAsync(String namespace)
      Clear all properties of a namespace asynchronously.

      Example:

           admin.namespaces().clearPropertiesAsync();
       
      Parameters:
      namespace - Namespace name
    • clearProperties

      void clearProperties(String namespace) throws PulsarAdminException
      Clear all properties of a namespace.

      Example:

           admin.namespaces().clearProperties();
       
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException
    • getNamespaceResourceGroup

      String getNamespaceResourceGroup(String namespace) throws PulsarAdminException
      Get the ResourceGroup for a namespace.

      Response example:

       60
       
      Parameters:
      namespace - Namespace name
      Returns:
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • getNamespaceResourceGroupAsync

      CompletableFuture<String> getNamespaceResourceGroupAsync(String namespace)
      Get the ResourceGroup for a namespace asynchronously.

      Response example:

       60
       
      Parameters:
      namespace - Namespace name
    • setNamespaceResourceGroup

      void setNamespaceResourceGroup(String namespace, String resourcegroupname) throws PulsarAdminException
      Set the ResourceGroup for a namespace.

      Request example:

       60
       
      Parameters:
      namespace - Namespace name
      resourcegroupname - ResourceGroup name
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • setNamespaceResourceGroupAsync

      CompletableFuture<Void> setNamespaceResourceGroupAsync(String namespace, String resourcegroupname)
      Set the ResourceGroup for a namespace asynchronously.

      Request example:

       60
       
      Parameters:
      namespace - Namespace name
      resourcegroupname - TTL values for all messages for all topics in this namespace
    • removeNamespaceResourceGroup

      void removeNamespaceResourceGroup(String namespace) throws PulsarAdminException
      Remove the ResourceGroup on a namespace.
      Parameters:
      namespace -
      Throws:
      PulsarAdminException
    • removeNamespaceResourceGroupAsync

      CompletableFuture<Void> removeNamespaceResourceGroupAsync(String namespace)
      Remove the ResourceGroup on a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
    • getNamespaceEntryFilters

      EntryFilters getNamespaceEntryFilters(String namespace) throws PulsarAdminException
      Get entry filters for a namespace.
      Parameters:
      namespace -
      Returns:
      entry filters classes info.
      Throws:
      PulsarAdminException
    • getNamespaceEntryFiltersAsync

      CompletableFuture<EntryFilters> getNamespaceEntryFiltersAsync(String namespace)
      Get entry filters for a namespace asynchronously.
      Parameters:
      namespace -
      Returns:
      entry filters classes info.
    • setNamespaceEntryFilters

      void setNamespaceEntryFilters(String namespace, EntryFilters entryFilters) throws PulsarAdminException
      Set entry filters on a namespace.
      Parameters:
      namespace - Namespace name
      entryFilters - The entry filters
      Throws:
      PulsarAdminException
    • setNamespaceEntryFiltersAsync

      CompletableFuture<Void> setNamespaceEntryFiltersAsync(String namespace, EntryFilters entryFilters)
      Set entry filters on a namespace asynchronously.
      Parameters:
      namespace - Namespace name
      entryFilters - The entry filters
    • removeNamespaceEntryFilters

      void removeNamespaceEntryFilters(String namespace) throws PulsarAdminException
      remove entry filters of a namespace.
      Parameters:
      namespace - Namespace name
      Throws:
      PulsarAdminException
    • removeNamespaceEntryFiltersAsync

      CompletableFuture<Void> removeNamespaceEntryFiltersAsync(String namespace)
      remove entry filters of a namespace asynchronously.
      Parameters:
      namespace - Namespace name
      Returns: