THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
/** * Represents the default name for an entity, i.e. the entity that's matched * when an exact match isn't found. */ public final static String QUOTA_ENTITY_DEFAULT = // implementation defined /** * Describes an entity type. */ public enum QuotaEntity { USER, // The user principal. CLIENT_ID, // The client ID. // Note others may be added in the future. } public class QuotaFilter { public enum Rule { EXACT, // exact name match NOT, // matches all non-matching names PREFIX, // matches all names with the given prefix // Note others may be added in the future. } /** * A filtering rule to be applied. * * @param entity the entity the rule applies to * @param rule the rule to apply * @param match the non-null string that's applied by the rule */ public QuotaFilter(QuotaEntity entity, Rule rule, String match); public QuotaEntity entity(); public Rule rule(); public String match(); } public class DescribeQuotasOptions { // Default. } public class DescribeQuotasResult { /** * @return the collection of entities that matched the filter */ KafkaFuture<Collection<Map<QuotaEntity, String>>> entities(); } public interface Admin extends AutoCloseable { /** * Describes all entities matching all provided filters (logical AND) that have at least one * quota value defined. */ DescribeQuotasResult* describeQuotas(Collection<QuotaFilter>@param filters, filtering DescribeQuotasOptions options); } |
Code Block |
rules to apply to matching entities /** * The@param quotaoptions types. the options to */use public enum QuotaType { * @return result containing all CONSUMER_BYTE_RATE, matching entities PRODUCER_BYTE_RATE, */ REQUEST_PERCENTAGE, DescribeQuotasResult describeQuotas(Collection<QuotaFilter> filters, DescribeQuotasOptions options); } |
Code Block |
---|
//** Note others may be added* inThe thequota futuretypes. } */ public classenum DescribeEffectiveQuotasOptionsQuotaType { // Whether to omit any inherited values in the result. If true, then undefined values forCONSUMER_BYTE_RATE, PRODUCER_BYTE_RATE, REQUEST_PERCENTAGE, // theNote entity'sothers configmay will be excludedadded fromin the resultsfuture. } public class DescribeEffectiveQuotasOptions //{ // Default: false. DescribeQuotasOptions setOmitInheritedValues(boolean omitInheritedValues); Whether to omit any inherited values in the result. If true, then undefined values for // Whetherthe toentity's includeconfig thewill listbe of overridden values for every quota type inexcluded from the resultresults. // // Default: false. DescribeQuotasOptions setOmitOverriddenValuessetOmitInheritedValues(boolean omitOverriddenValuesomitInheritedValues); } public// classWhether DescribeEffectiveQuotasResultto { include the list of overridden values for every /** quota type in the result. // * Information about a specific quota// configurationDefault: valuefalse. DescribeQuotasOptions */setOmitOverriddenValues(boolean omitOverriddenValues); } public class ValueDescribeEffectiveQuotasResult { /** * Information about a *specific @paramquota sourceconfiguration thevalue. entity source for the value */ public *class @paramValue value{ the non-null value /** */ * @param source public Value(Map<QuotaEntity, String> source, Double value); the entity source for the value public Map<QuotaEntity, String> source(); * @param value the non-null value public Double value(); */ } public Value(Map<QuotaEntity, String> source, /**Double value); * Information about thepublic valueMap<QuotaEntity, for a quota type. String> source(); */ public Double value(); public class Entry { } /** * Information about * @paramthe value thefor activea quota valuetype. */ * @param overriddenValues all valuespublic thatclass are overridden due to being lower in specificityEntry { /**/ public* Entry(Value@param value, List<Value> overriddenValues); the active quota value public Value value(); * @param overriddenValues all values that are overridden due to being publiclower List<Value> overriddenValues();in specificity } */ /** public * Maps a quota type to its configuration entry. Entry(Value value, List<Value> overriddenValues); public Value *value(); * Note that if `options.omitInheritedValues` is true, then this config may not map everypublic List<Value> overriddenValues(); } /** * Maps a quota type to its anconfiguration entry. If a key is not contained in the map,* then that quota type's value * Note that if `options.omitInheritedValues` is true, then this config may not map every * is not specified quota type to an entry. If a key is not contained in the map, then that quota type's value * is not specified. */ public KafkaFuture<Map<QuotaType, Entry>> config(); } public interface Admin extends AutoCloseable { /** * Describes the effective quotas for the provided entities. */ * public@param KafkaFuture<Map<QuotaType,entities Entry>> config(); } public interface Admin extends AutoCloseable { /**the entities to describe the effective quotas for * @param options the options to use * Describes@return the effective quotas for the provided entities. */ DescribeEffectiveQuotasResult describeEffectiveQuotas(Collection<QuotaEntity> quotaEntitiesentities, DescribeEffectiveQuotasOptions options); } |
...