public interface Namespaces
| Modifier and Type | Method and Description |
|---|---|
void |
clearNamespaceBacklog(String namespace)
Clear backlog for all topics on a namespace
|
void |
clearNamespaceBacklogForSubscription(String namespace,
String subscription)
Clear backlog for a given subscription on all topics on a namespace
|
void |
clearNamespaceBundleBacklog(String namespace,
String bundle)
Clear backlog for all topics on a namespace bundle
|
void |
clearNamespaceBundleBacklogForSubscription(String namespace,
String bundle,
String subscription)
Clear backlog for a given subscription on all topics on a namespace bundle
|
void |
createNamespace(String namespace)
Create a new namespace.
|
void |
createNamespace(String namespace,
BundlesData bundlesData)
Create a new namespace.
|
void |
createNamespace(String namespace,
int numBundles)
Create a new namespace.
|
void |
createNamespace(String namespace,
Policies policies)
Create a new namespace.
|
void |
createNamespace(String namespace,
Set<String> clusters)
Create a new namespace.
|
void |
deleteNamespace(String namespace)
Delete an existing namespace.
|
void |
deleteNamespaceAntiAffinityGroup(String namespace)
Delete anti-affinity group name for a namespace.
|
void |
deleteNamespaceBundle(String namespace,
String bundleRange)
Delete an existing bundle in a namespace.
|
List<String> |
getAntiAffinityNamespaces(String tenant,
String cluster,
String namespaceAntiAffinityGroup)
Get all namespaces that grouped with given anti-affinity group
|
Map<BacklogQuota.BacklogQuotaType,BacklogQuota> |
getBacklogQuotaMap(String namespace)
Get backlog quota map on a namespace.
|
DispatchRate |
getDispatchRate(String namespace)
Get message-dispatch-rate (topics under this namespace can dispatch this many messages per second)
|
int |
getMaxConsumersPerSubscription(String namespace)
Get the maxConsumersPerSubscription for a namespace.
|
int |
getMaxConsumersPerTopic(String namespace)
Get the maxProducersPerTopic for a namespace.
|
int |
getMaxProducersPerTopic(String namespace)
Get the maxProducersPerTopic for a namespace.
|
String |
getNamespaceAntiAffinityGroup(String namespace)
Get anti-affinity group name for a namespace
|
int |
getNamespaceMessageTTL(String namespace)
Get the message TTL for a namespace.
|
List<String> |
getNamespaceReplicationClusters(String namespace)
Get the replication clusters for a namespace.
|
List<String> |
getNamespaces(String tenant)
Get the list of namespaces.
|
List<String> |
getNamespaces(String tenant,
String cluster)
Deprecated.
|
Map<String,Set<AuthAction>> |
getPermissions(String namespace)
Get permissions on a namespace.
|
PersistencePolicies |
getPersistence(String namespace)
Get the persistence configuration for a namespace.
|
Policies |
getPolicies(String namespace)
Get policies for a namespace.
|
String |
getReplicationConfigVersion(String namespace)
Get the replication configuration version for a given namespace
|
RetentionPolicies |
getRetention(String namespace)
Get the retention configuration for a namespace.
|
DispatchRate |
getSubscriptionDispatchRate(String namespace)
Get subscription-message-dispatch-rate (subscriptions under this namespace can dispatch this many messages per second)
|
List<String> |
getTopics(String namespace)
Get the list of topics.
|
void |
grantPermissionOnNamespace(String namespace,
String role,
Set<AuthAction> actions)
Grant permission on a namespace.
|
void |
removeBacklogQuota(String namespace)
Remove a backlog quota policy from a namespace.
|
void |
revokePermissionsOnNamespace(String namespace,
String role)
Revoke permissions on a namespace.
|
void |
setBacklogQuota(String namespace,
BacklogQuota backlogQuota)
Set a backlog quota for all the topics on a namespace.
|
void |
setDeduplicationStatus(String namespace,
boolean enableDeduplication)
Set the deduplication status for all topics within a namespace.
|
void |
setDispatchRate(String namespace,
DispatchRate dispatchRate)
Set message-dispatch-rate (topics under this namespace can dispatch this many messages per second)
|
void |
setEncryptionRequiredStatus(String namespace,
boolean encryptionRequired)
Set the encryption required status for all topics within a namespace.
|
void |
setMaxConsumersPerSubscription(String namespace,
int maxConsumersPerSubscription)
Set maxConsumersPerSubscription for a namespace.
|
void |
setMaxConsumersPerTopic(String namespace,
int maxConsumersPerTopic)
Set maxConsumersPerTopic for a namespace.
|
void |
setMaxProducersPerTopic(String namespace,
int maxProducersPerTopic)
Set maxProducersPerTopic for a namespace.
|
void |
setNamespaceAntiAffinityGroup(String namespace,
String namespaceAntiAffinityGroup)
Set anti-affinity group name for a namespace
|
void |
setNamespaceMessageTTL(String namespace,
int ttlInSeconds)
Set the messages Time to Live for all the topics within a namespace.
|
void |
setNamespaceReplicationClusters(String namespace,
Set<String> clusterIds)
Set the replication clusters for a namespace.
|
void |
setPersistence(String namespace,
PersistencePolicies persistence)
Set the persistence configuration for all the topics on a namespace.
|
void |
setRetention(String namespace,
RetentionPolicies retention)
Set the retention configuration for all the topics on a namespace.
|
void |
setSubscriptionAuthMode(String namespace,
SubscriptionAuthMode subscriptionAuthMode)
Set the given subscription auth mode on all topics on a namespace
|
void |
setSubscriptionDispatchRate(String namespace,
DispatchRate dispatchRate)
Set subscription-message-dispatch-rate (subscriptions under this namespace can dispatch this many messages per second)
|
void |
splitNamespaceBundle(String namespace,
String bundle,
boolean unloadSplitBundles)
Split namespace bundle
|
void |
unload(String namespace)
Unload a namespace from the current serving broker.
|
void |
unloadNamespaceBundle(String namespace,
String bundle)
Unload namespace bundle
|
void |
unsubscribeNamespace(String namespace,
String subscription)
Unsubscribes the given subscription on all topics on a namespace
|
void |
unsubscribeNamespaceBundle(String namespace,
String bundle,
String subscription)
Unsubscribes the given subscription on all topics on a namespace bundle
|
List<String> getNamespaces(String tenant) throws PulsarAdminException
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"]
tenant - Tenant namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Tenant does not existPulsarAdminException - Unexpected error@Deprecated List<String> getNamespaces(String tenant, String cluster) throws PulsarAdminException
Get the list of all the namespaces for a certain tenant on single cluster.
Response Example:
["my-tenant/use/namespace1", "my-tenant/use/namespace2"]
tenant - Tenant namecluster - Cluster namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Tenant or cluster does not existPulsarAdminException - Unexpected errorList<String> getTopics(String namespace) throws PulsarAdminException
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"]
namespace - Namespace namePulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorPolicies getPolicies(String namespace) throws PulsarAdminException
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
}
namespace - Namespace namePulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorPoliciesvoid createNamespace(String namespace, int numBundles) throws PulsarAdminException
Creates a new empty namespace with no policies attached.
namespace - Namespace namenumBundles - Number of bundlesPulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Tenant or cluster does not existPulsarAdminException.ConflictException - Namespace already existsPulsarAdminException - Unexpected errorvoid createNamespace(String namespace, BundlesData bundlesData) throws PulsarAdminException
Creates a new empty namespace with no policies attached.
namespace - Namespace namebundlesData - Bundles DataPulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Tenant or cluster does not existPulsarAdminException.ConflictException - Namespace already existsPulsarAdminException - Unexpected errorvoid createNamespace(String namespace) throws PulsarAdminException
Creates a new empty namespace with no policies attached.
namespace - Namespace namePulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Tenant or cluster does not existPulsarAdminException.ConflictException - Namespace already existsPulsarAdminException - Unexpected errorvoid createNamespace(String namespace, Set<String> clusters) throws PulsarAdminException
Creates a new empty namespace with no policies attached.
namespace - Namespace nameclusters - Clusters in which the namespace will be present. If more than one cluster is present, replication
across clusters will be enabled.PulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Tenant or cluster does not existPulsarAdminException.ConflictException - Namespace already existsPulsarAdminException - Unexpected errorvoid createNamespace(String namespace, Policies policies) throws PulsarAdminException
Creates a new namespace with the specified policies.
namespace - Namespace namepolicies - Policies for the namespacePulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Tenant or cluster does not existPulsarAdminException.ConflictException - Namespace already existsPulsarAdminException - Unexpected errorvoid deleteNamespace(String namespace) throws PulsarAdminException
The namespace needs to be empty.
namespace - Namespace namePulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException.ConflictException - Namespace is not emptyPulsarAdminException - Unexpected errorvoid deleteNamespaceBundle(String namespace, String bundleRange) throws PulsarAdminException
The bundle needs to be empty.
namespace - Namespace namebundleRange - range of the bundlePulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Namespace/bundle does not existPulsarAdminException.ConflictException - Bundle is not emptyPulsarAdminException - Unexpected errorMap<String,Set<AuthAction>> getPermissions(String namespace) throws PulsarAdminException
Retrieve the permissions for a namespace.
Response example:
{
"my-role" : [ "produce" ]
"other-role" : [ "consume" ]
}
namespace - Namespace namePulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid grantPermissionOnNamespace(String namespace, String role, Set<AuthAction> actions) throws PulsarAdminException
Grant a new permission to a client role on a namespace.
Request parameter example:
["produce", "consume"]
namespace - Namespace namerole - Client role to which grant permissionactions - Auth actions (produce and consume)PulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException.ConflictException - Concurrent modificationPulsarAdminException - Unexpected errorvoid revokePermissionsOnNamespace(String namespace, String role) throws PulsarAdminException
Revoke all permissions to a client role on a namespace.
namespace - Namespace namerole - Client role to which remove permissionsPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorList<String> getNamespaceReplicationClusters(String namespace) throws PulsarAdminException
Response example:
["use", "usw", "usc"]
namespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException.PreconditionFailedException - Namespace is not globalPulsarAdminException - Unexpected errorvoid setNamespaceReplicationClusters(String namespace, Set<String> clusterIds) throws PulsarAdminException
Request example:
["us-west", "us-east", "us-cent"]
namespace - Namespace nameclusterIds - Pulsar Cluster IdsPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException.PreconditionFailedException - Namespace is not globalPulsarAdminException.PreconditionFailedException - Invalid cluster idsPulsarAdminException - Unexpected errorint getNamespaceMessageTTL(String namespace) throws PulsarAdminException
Response example:
60
namespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid setNamespaceMessageTTL(String namespace, int ttlInSeconds) throws PulsarAdminException
Request example:
60
namespace - Namespace namettlInSeconds - TTL values for all messages for all topics in this namespacePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid setNamespaceAntiAffinityGroup(String namespace, String namespaceAntiAffinityGroup) throws PulsarAdminException
Request example:
namespace - Namespace namenamespaceAntiAffinityGroup - anti-affinity group name for a namespacePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorList<String> getAntiAffinityNamespaces(String tenant, String cluster, String namespaceAntiAffinityGroup) throws PulsarAdminException
tenant - tenant is only used for authorization. Client has to be admin of any of the tenant to access this
api api.cluster - cluster namenamespaceAntiAffinityGroup - Anti-affinity group namePulsarAdminExceptionString getNamespaceAntiAffinityGroup(String namespace) throws PulsarAdminException
Response example:
60
namespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid deleteNamespaceAntiAffinityGroup(String namespace) throws PulsarAdminException
namespace - Namespace namePulsarAdminException.NotAuthorizedException - You don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid setDeduplicationStatus(String namespace, boolean enableDeduplication) throws PulsarAdminException
When deduplication is enabled, the broker will prevent to store the same message multiple times.
Request example:
true
namespace - Namespace nameenableDeduplication - wether to enable or disable deduplication featurePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorMap<BacklogQuota.BacklogQuotaType,BacklogQuota> getBacklogQuotaMap(String namespace) throws PulsarAdminException
Get backlog quota map on a namespace.
Response example:
{
"namespace_memory" : {
"limit" : "134217728",
"policy" : "consumer_backlog_eviction"
},
"destination_storage" : {
"limit" : "-1",
"policy" : "producer_exception"
}
}
namespace - Namespace namePulsarAdminException.NotAuthorizedException - Permission deniedPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid setBacklogQuota(String namespace, BacklogQuota backlogQuota) throws PulsarAdminException
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"
}
namespace - Namespace namebacklogQuota - the new BacklogQuotaPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid removeBacklogQuota(String namespace) throws PulsarAdminException
Remove a backlog quota policy from a namespace.
The backlog retention policy will fall back to the default.
namespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid setPersistence(String namespace, PersistencePolicies persistence) throws PulsarAdminException
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
}
tenant - Tenant namecluster - Cluster namenamespace - Namespace namepersistence - Persistence policies objectPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException.ConflictException - Concurrent modificationPulsarAdminException - Unexpected errorPersistencePolicies getPersistence(String namespace) throws PulsarAdminException
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
}
tenant - Tenant namecluster - Cluster namenamespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException.ConflictException - Concurrent modificationPulsarAdminException - Unexpected errorvoid setRetention(String namespace, RetentionPolicies retention) throws PulsarAdminException
{
"retentionTimeInMinutes" : 60, // how long to retain messages
"retentionSizeInMB" : 1024, // retention backlog limit
}
namespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException.ConflictException - Concurrent modificationPulsarAdminException - Unexpected errorRetentionPolicies getRetention(String namespace) throws PulsarAdminException
{
"retentionTimeInMinutes" : 60, // how long to retain messages
"retentionSizeInMB" : 1024, // retention backlog limit
}
namespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException.ConflictException - Concurrent modificationPulsarAdminException - Unexpected errorvoid unload(String namespace) throws PulsarAdminException
namespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException.PreconditionFailedException - Namespace is already unloadedPulsarAdminException - Unexpected errorString getReplicationConfigVersion(String namespace) throws PulsarAdminException
namespace - PulsarAdminException - Unexpected errorvoid unloadNamespaceBundle(String namespace, String bundle) throws PulsarAdminException
namespace - PulsarAdminException - Unexpected errorvoid splitNamespaceBundle(String namespace, String bundle, boolean unloadSplitBundles) throws PulsarAdminException
namespace - range - of bundle to splitunload - newly split bundles from the brokerPulsarAdminException - Unexpected errorvoid setDispatchRate(String namespace, DispatchRate dispatchRate) throws PulsarAdminException
namespace - messageRate - number of messages per secondPulsarAdminException - Unexpected errorDispatchRate getDispatchRate(String namespace) throws PulsarAdminException
namespace - PulsarAdminException - Unexpected errorvoid setSubscriptionDispatchRate(String namespace, DispatchRate dispatchRate) throws PulsarAdminException
namespace - dispatchRate - number of messages per secondPulsarAdminException - Unexpected errorDispatchRate getSubscriptionDispatchRate(String namespace) throws PulsarAdminException
namespace - PulsarAdminException - Unexpected errorvoid clearNamespaceBacklog(String namespace) throws PulsarAdminException
namespace - PulsarAdminException - Unexpected errorvoid clearNamespaceBacklogForSubscription(String namespace, String subscription) throws PulsarAdminException
namespace - subscription - PulsarAdminException - Unexpected errorvoid clearNamespaceBundleBacklog(String namespace, String bundle) throws PulsarAdminException
namespace - bundle - PulsarAdminException - Unexpected errorvoid clearNamespaceBundleBacklogForSubscription(String namespace, String bundle, String subscription) throws PulsarAdminException
namespace - bundle - subscription - PulsarAdminException - Unexpected errorvoid unsubscribeNamespace(String namespace, String subscription) throws PulsarAdminException
namespace - subscription - PulsarAdminExceptionvoid unsubscribeNamespaceBundle(String namespace, String bundle, String subscription) throws PulsarAdminException
namespace - bundle - subscription - PulsarAdminExceptionvoid setEncryptionRequiredStatus(String namespace, boolean encryptionRequired) throws PulsarAdminException
When encryption required is true, the broker will prevent to store unencrypted messages.
Request example:
true
namespace - Namespace nameencryptionRequired - whether message encryption is required or notPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid setSubscriptionAuthMode(String namespace, SubscriptionAuthMode subscriptionAuthMode) throws PulsarAdminException
namespace - subscriptionAuthMode - PulsarAdminExceptionint getMaxProducersPerTopic(String namespace) throws PulsarAdminException
Response example:
0
namespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid setMaxProducersPerTopic(String namespace, int maxProducersPerTopic) throws PulsarAdminException
Request example:
10
namespace - Namespace namemaxProducersPerTopic - maxProducersPerTopic value for a namespacePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorint getMaxConsumersPerTopic(String namespace) throws PulsarAdminException
Response example:
0
namespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid setMaxConsumersPerTopic(String namespace, int maxConsumersPerTopic) throws PulsarAdminException
Request example:
10
namespace - Namespace namemaxConsumersPerTopic - maxConsumersPerTopic value for a namespacePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorint getMaxConsumersPerSubscription(String namespace) throws PulsarAdminException
Response example:
0
namespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorvoid setMaxConsumersPerSubscription(String namespace, int maxConsumersPerSubscription) throws PulsarAdminException
Request example:
10
namespace - Namespace namemaxConsumersPerSubscription - maxConsumersPerSubscription value for a namespacePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorCopyright © 2017–2018 Apache Software Foundation. All rights reserved.