Package org.apache.pulsar.client.admin
Interface ResourceQuotas
public interface ResourceQuotas
Admin interface on interacting with resource quotas.
-
Method Summary
Modifier and TypeMethodDescriptionGet default resource quota for new resource bundles.Get default resource quota for new resource bundles asynchronously.getNamespaceBundleResourceQuota
(String namespace, String bundle) Get resource quota of a namespace bundle.getNamespaceBundleResourceQuotaAsync
(String namespace, String bundle) Get resource quota of a namespace bundle asynchronously.void
resetNamespaceBundleResourceQuota
(String namespace, String bundle) Reset resource quota for a namespace bundle to default value.resetNamespaceBundleResourceQuotaAsync
(String namespace, String bundle) Reset resource quota for a namespace bundle to default value asynchronously.void
Set default resource quota for new namespace bundles.Set default resource quota for new namespace bundles asynchronously.void
setNamespaceBundleResourceQuota
(String namespace, String bundle, ResourceQuota quota) Set resource quota for a namespace bundle.setNamespaceBundleResourceQuotaAsync
(String namespace, String bundle, ResourceQuota quota) Set resource quota for a namespace bundle asynchronously.
-
Method Details
-
getDefaultResourceQuota
Get default resource quota for new resource bundles. Get default resource quota for new resource bundles. Response example:{ "msgRateIn" : 10, "msgRateOut" : 30, "bandwidthIn" : 10000, "bandwidthOut" : 30000, "memory" : 100, "dynamic" : true }
- Throws:
PulsarAdminException.NotAuthorizedException
- Permission deniedPulsarAdminException
- Unexpected error
-
getDefaultResourceQuotaAsync
CompletableFuture<ResourceQuota> getDefaultResourceQuotaAsync()Get default resource quota for new resource bundles asynchronously. Get default resource quota for new resource bundles. Response example:{ "msgRateIn" : 10, "msgRateOut" : 30, "bandwidthIn" : 10000, "bandwidthOut" : 30000, "memory" : 100, "dynamic" : true }
-
setDefaultResourceQuota
Set default resource quota for new namespace bundles. Set default resource quota for new namespace bundles. The resource quota can be set with these properties:msgRateIn
: The maximum incoming messages per second.msgRateOut
: The maximum outgoing messages per second.bandwidthIn
: The maximum inbound bandwidth used.bandwidthOut
: The maximum outbound bandwidth used.memory
: The maximum memory used.dynamic
: allow the quota to be dynamically re-calculated.
{ "msgRateIn" : 10, "msgRateOut" : 30, "bandwidthIn" : 10000, "bandwidthOut" : 30000, "memory" : 100, "dynamic" : false }
- Parameters:
quota
- The new ResourceQuota- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException
- Unexpected error
-
setDefaultResourceQuotaAsync
Set default resource quota for new namespace bundles asynchronously. Set default resource quota for new namespace bundles. The resource quota can be set with these properties:msgRateIn
: The maximum incoming messages per second.msgRateOut
: The maximum outgoing messages per second.bandwidthIn
: The maximum inbound bandwidth used.bandwidthOut
: The maximum outbound bandwidth used.memory
: The maximum memory used.dynamic
: allow the quota to be dynamically re-calculated.
{ "msgRateIn" : 10, "msgRateOut" : 30, "bandwidthIn" : 10000, "bandwidthOut" : 30000, "memory" : 100, "dynamic" : false }
- Parameters:
quota
- The new ResourceQuota
-
getNamespaceBundleResourceQuota
ResourceQuota getNamespaceBundleResourceQuota(String namespace, String bundle) throws PulsarAdminException Get resource quota of a namespace bundle. Get resource quota of a namespace bundle. Response example:{ "msgRateIn" : 10, "msgRateOut" : 30, "bandwidthIn" : 10000, "bandwidthOut" : 30000, "memory" : 100, "dynamic" : true }
- Parameters:
namespace
- Namespace namebundle
- Range of bundle {start}_{end}- Throws:
PulsarAdminException.NotAuthorizedException
- Permission deniedPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
getNamespaceBundleResourceQuotaAsync
CompletableFuture<ResourceQuota> getNamespaceBundleResourceQuotaAsync(String namespace, String bundle) Get resource quota of a namespace bundle asynchronously. Get resource quota of a namespace bundle. Response example:{ "msgRateIn" : 10, "msgRateOut" : 30, "bandwidthIn" : 10000, "bandwidthOut" : 30000, "memory" : 100, "dynamic" : true }
- Parameters:
namespace
- Namespace namebundle
- Range of bundle {start}_{end}
-
setNamespaceBundleResourceQuota
void setNamespaceBundleResourceQuota(String namespace, String bundle, ResourceQuota quota) throws PulsarAdminException Set resource quota for a namespace bundle. Set resource quota for a namespace bundle. The resource quota can be set with these properties:msgRateIn
: The maximum incoming messages per second.msgRateOut
: The maximum outgoing messages per second.bandwidthIn
: The maximum inbound bandwidth used.bandwidthOut
: The maximum outbound bandwidth used.memory
: The maximum memory used.dynamic
: allow the quota to be dynamically re-calculated.
{ "msgRateIn" : 10, "msgRateOut" : 30, "bandwidthIn" : 10000, "bandwidthOut" : 30000, "memory" : 100, "dynamic" : false }
- Parameters:
namespace
- Namespace namebundle
- Bundle range {start}_{end}quota
- The new ResourceQuota- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
setNamespaceBundleResourceQuotaAsync
CompletableFuture<Void> setNamespaceBundleResourceQuotaAsync(String namespace, String bundle, ResourceQuota quota) Set resource quota for a namespace bundle asynchronously. Set resource quota for a namespace bundle. The resource quota can be set with these properties:msgRateIn
: The maximum incoming messages per second.msgRateOut
: The maximum outgoing messages per second.bandwidthIn
: The maximum inbound bandwidth used.bandwidthOut
: The maximum outbound bandwidth used.memory
: The maximum memory used.dynamic
: allow the quota to be dynamically re-calculated.
{ "msgRateIn" : 10, "msgRateOut" : 30, "bandwidthIn" : 10000, "bandwidthOut" : 30000, "memory" : 100, "dynamic" : false }
- Parameters:
namespace
- Namespace namebundle
- Bundle range {start}_{end}quota
- The new ResourceQuota
-
resetNamespaceBundleResourceQuota
Reset resource quota for a namespace bundle to default value. Reset resource quota for a namespace bundle to default value. The resource quota policy will fall back to the default.- Parameters:
namespace
- Namespace namebundle
- Bundle range {start}_{end}- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
resetNamespaceBundleResourceQuotaAsync
Reset resource quota for a namespace bundle to default value asynchronously. Reset resource quota for a namespace bundle to default value. The resource quota policy will fall back to the default.- Parameters:
namespace
- Namespace namebundle
- Bundle range {start}_{end}
-