Interface ResourceQuotas


public interface ResourceQuotas
Admin interface on interacting with resource quotas.
  • Method Details

    • getDefaultResourceQuota

      ResourceQuota getDefaultResourceQuota() throws PulsarAdminException
      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 denied
      PulsarAdminException - 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

      void setDefaultResourceQuota(ResourceQuota quota) throws PulsarAdminException
      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.

      Request parameter example:

       
        {
            "msgRateIn" : 10,
            "msgRateOut" : 30,
            "bandwidthIn" : 10000,
            "bandwidthOut" : 30000,
            "memory" : 100,
            "dynamic" : false
        }
       
       
      Parameters:
      quota - The new ResourceQuota
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException - Unexpected error
    • setDefaultResourceQuotaAsync

      CompletableFuture<Void> setDefaultResourceQuotaAsync(ResourceQuota quota)
      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.

      Request parameter example:

       
        {
            "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 name
      bundle - Range of bundle {start}_{end}
      Throws:
      PulsarAdminException.NotAuthorizedException - Permission denied
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - 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 name
      bundle - 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.

      Request parameter example:

       
        {
            "msgRateIn" : 10,
            "msgRateOut" : 30,
            "bandwidthIn" : 10000,
            "bandwidthOut" : 30000,
            "memory" : 100,
            "dynamic" : false
        }
       
       
      Parameters:
      namespace - Namespace name
      bundle - Bundle range {start}_{end}
      quota - The new ResourceQuota
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - 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.

      Request parameter example:

       
        {
            "msgRateIn" : 10,
            "msgRateOut" : 30,
            "bandwidthIn" : 10000,
            "bandwidthOut" : 30000,
            "memory" : 100,
            "dynamic" : false
        }
       
       
      Parameters:
      namespace - Namespace name
      bundle - Bundle range {start}_{end}
      quota - The new ResourceQuota
    • resetNamespaceBundleResourceQuota

      void resetNamespaceBundleResourceQuota(String namespace, String bundle) throws PulsarAdminException
      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 name
      bundle - Bundle range {start}_{end}
      Throws:
      PulsarAdminException.NotAuthorizedException - Don't have admin permission
      PulsarAdminException.NotFoundException - Namespace does not exist
      PulsarAdminException - Unexpected error
    • resetNamespaceBundleResourceQuotaAsync

      CompletableFuture<Void> resetNamespaceBundleResourceQuotaAsync(String namespace, String bundle)
      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 name
      bundle - Bundle range {start}_{end}