Interface ResourceQuotas


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

      • getDefaultResourceQuotaAsync

        java.util.concurrent.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

        java.util.concurrent.CompletableFuture<java.lang.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
      • getNamespaceBundleResourceQuotaAsync

        java.util.concurrent.CompletableFuture<ResourceQuota> getNamespaceBundleResourceQuotaAsync​(java.lang.String namespace,
                                                                                                   java.lang.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​(java.lang.String namespace,
                                             java.lang.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

        java.util.concurrent.CompletableFuture<java.lang.Void> setNamespaceBundleResourceQuotaAsync​(java.lang.String namespace,
                                                                                                    java.lang.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​(java.lang.String namespace,
                                               java.lang.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

        java.util.concurrent.CompletableFuture<java.lang.Void> resetNamespaceBundleResourceQuotaAsync​(java.lang.String namespace,
                                                                                                      java.lang.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}