public class ResourceQuotasImpl extends BaseResource implements ResourceQuotas
| Constructor and Description |
|---|
ResourceQuotasImpl(javax.ws.rs.client.WebTarget web,
Authentication auth) |
| Modifier and Type | Method and Description |
|---|---|
ResourceQuota |
getDefaultResourceQuota()
Get default resource quota for new resource bundles.
|
ResourceQuota |
getNamespaceBundleResourceQuota(String namespace,
String bundle)
Get resource quota of a namespace bundle.
|
void |
resetNamespaceBundleResourceQuota(String namespace,
String bundle)
Reset resource quota for a namespace bundle to default value.
|
void |
setDefaultResourceQuota(ResourceQuota quota)
Set default resource quota for new namespace bundles.
|
void |
setNamespaceBundleResourceQuota(String namespace,
String bundle,
ResourceQuota quota)
Set resource quota for a namespace bundle.
|
asyncDeleteRequest, asyncGetRequest, asyncPostRequest, asyncPutRequest, getApiException, requestpublic ResourceQuotasImpl(javax.ws.rs.client.WebTarget web,
Authentication auth)
public ResourceQuota getDefaultResourceQuota() throws PulsarAdminException
ResourceQuotasGet default resource quota for new resource bundles.
Response example:
{
"msgRateIn" : 10,
"msgRateOut" : 30,
"bandwidthIn" : 10000,
"bandwidthOut" : 30000,
"memory" : 100,
"dynamic" : true
}
getDefaultResourceQuota in interface ResourceQuotasPulsarAdminException.NotAuthorizedException - Permission deniedPulsarAdminException - Unexpected errorpublic void setDefaultResourceQuota(ResourceQuota quota) throws PulsarAdminException
ResourceQuotasSet 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.
Request parameter example:
{
"msgRateIn" : 10,
"msgRateOut" : 30,
"bandwidthIn" : 10000,
"bandwidthOut" : 30000,
"memory" : 100,
"dynamic" : false
}
setDefaultResourceQuota in interface ResourceQuotasquota - The new ResourceQuotaPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException - Unexpected errorpublic ResourceQuota getNamespaceBundleResourceQuota(String namespace, String bundle) throws PulsarAdminException
ResourceQuotasGet resource quota of a namespace bundle.
Response example:
{
"msgRateIn" : 10,
"msgRateOut" : 30,
"bandwidthIn" : 10000,
"bandwidthOut" : 30000,
"memory" : 100,
"dynamic" : true
}
getNamespaceBundleResourceQuota in interface ResourceQuotasnamespace - Namespace namebundle - Range of bundle {start}_{end}PulsarAdminException.NotAuthorizedException - Permission deniedPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorpublic void setNamespaceBundleResourceQuota(String namespace, String bundle, ResourceQuota quota) throws PulsarAdminException
ResourceQuotasSet 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.
Request parameter example:
{
"msgRateIn" : 10,
"msgRateOut" : 30,
"bandwidthIn" : 10000,
"bandwidthOut" : 30000,
"memory" : 100,
"dynamic" : false
}
setNamespaceBundleResourceQuota in interface ResourceQuotasnamespace - Namespace namebundle - Bundle range {start}_{end}quota - The new ResourceQuotaPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorpublic void resetNamespaceBundleResourceQuota(String namespace, String bundle) throws PulsarAdminException
ResourceQuotasReset resource quota for a namespace bundle to default value.
The resource quota policy will fall back to the default.
resetNamespaceBundleResourceQuota in interface ResourceQuotasnamespace - Namespace namebundle - Bundle range {start}_{end}PulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorCopyright © 2017–2018 Apache Software Foundation. All rights reserved.