Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.pulsar.client.admin;
import java.util.concurrent.CompletableFuture;
import org.apache.pulsar.client.admin.PulsarAdminException.NotAuthorizedException;
import org.apache.pulsar.client.admin.PulsarAdminException.NotFoundException;
import org.apache.pulsar.common.policies.data.ResourceQuota;
/**
* Admin interface on interacting with resource quotas.
*/
public interface ResourceQuotas {
/**
* Get default resource quota for new resource bundles.
*
* Get default resource quota for new resource bundles.
*
* Response example:
*
*
*
*/
CompletableFuture getDefaultResourceQuotaAsync();
/**
* 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.
*
*
* @param quota
* The new ResourceQuota
*
* @throws NotAuthorizedException
* Don't have admin permission
* @throws PulsarAdminException
* Unexpected error
*/
void setDefaultResourceQuota(ResourceQuota quota) throws PulsarAdminException;
/**
* 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.
*
*
* @param quota
* The new ResourceQuota
*/
CompletableFuture setDefaultResourceQuotaAsync(ResourceQuota quota);
/**
* Get resource quota of a namespace bundle.
*
* Get resource quota of a namespace bundle.
*
* Response example:
*
*
*
* @param namespace
* Namespace name
* @param bundle
* Range of bundle {start}_{end}
*
*/
CompletableFuture getNamespaceBundleResourceQuotaAsync(String namespace, String bundle);
/**
* 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.
*
*
* @param namespace
* Namespace name
* @param bundle
* Bundle range {start}_{end}
* @param quota
* The new ResourceQuota
*
* @throws NotAuthorizedException
* Don't have admin permission
* @throws NotFoundException
* Namespace does not exist
* @throws PulsarAdminException
* Unexpected error
*/
void setNamespaceBundleResourceQuota(String namespace, String bundle, ResourceQuota quota)
throws PulsarAdminException;
/**
* 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.
*
*
* @param namespace
* Namespace name
* @param bundle
* Bundle range {start}_{end}
* @param quota
* The new ResourceQuota
*
*/
CompletableFuture setNamespaceBundleResourceQuotaAsync(String namespace, String bundle, ResourceQuota quota);
/**
* 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.
*
* @param namespace
* Namespace name
* @param bundle
* Bundle range {start}_{end}
*
* @throws NotAuthorizedException
* Don't have admin permission
* @throws NotFoundException
* Namespace does not exist
* @throws PulsarAdminException
* Unexpected error
*/
void resetNamespaceBundleResourceQuota(String namespace, String bundle) throws PulsarAdminException;
/**
* 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.
*
* @param namespace
* Namespace name
* @param bundle
* Bundle range {start}_{end}
*
*/
CompletableFuture resetNamespaceBundleResourceQuotaAsync(String namespace, String bundle);
}