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 {/** * The quota types. */ public enum RuleQuotaType { EXACT,CONSUMER_BYTE_RATE, // exact name match PRODUCER_BYTE_RATE, REQUEST_PERCENTAGE, NOT, // matchesNote allothers non-matching names may be added in the future. } PREFIX, //public matchesclass allQuotaFilter names{ with the given prefix public enum Rule { // Note others may be added inEXACT, the future. // exact name match } /** NOT, // matches *all A filtering rule to be applied. non-matching names PREFIX, * // matches all names with the given prefix * @param entity the entity the rule applies to * @param rule the rule to apply // Note others may be added in the future. } /** * @param match the non-null string that's applied* byA thefiltering rule to be applied. */ public QuotaFilter(QuotaEntity * @param entity the entity, Rulethe rule, Stringapplies match);to public QuotaEntity entity(); public Rule rule(); * @param rule the rule to apply * public@param String match(); the non-null } public class DescribeQuotasOptions {string that's applied by the rule *// Default. } public QuotaFilter(QuotaEntity entity, publicRule classrule, DescribeQuotasResult {String match); /**public QuotaEntity entity(); public Rule *rule(); @return the collection of entities that matchedpublic the filterString match(); } public class DescribeQuotasOptions */{ KafkaFuture<Collection<Map<QuotaEntity, String>>> entities();// Default. } public interface Admin extends AutoCloseableclass DescribeQuotasResult { /** * DescribesMaps allan entitiesentity matchingto allits providedconfigured filtersquota value(logical ANDs). thatNote haveif atno leastvalue one is defined * quota value defined.for a quota * type for that entity's config, then it is *not @paramincluded filtersin filteringthe rulesresulting to apply to matching entitiesvalue map. * @param options the options to use * @return the *collection @returnof resultentities containingthat allmatched matchingthe entitiesfilter */ DescribeQuotasResult describeQuotas(Collection<QuotaFilter> filtersKafkaFuture<Map<Map<QuotaEntity, String>, Map<QuotaType, DescribeQuotasOptionsDouble>>> optionsentities(); } |
Code Block |
/** public interface Admin extends AutoCloseable *{ The quota types. /**/ public enum QuotaType { * Describes all entities matching CONSUMER_BYTE_RATE, PRODUCER_BYTE_RATE, REQUEST_PERCENTAGE, // Note others may be added in the future. } public class DescribeEffectiveQuotasOptions { // Whether to omit any inherited values in the result. If true, then undefined values for // the entity's config will be excluded from the results. // all provided filters (logical AND) that have at least one * quota // Default: falsevalue defined. DescribeQuotasOptions setOmitInheritedValues(boolean omitInheritedValues); * // Whether* to@param includefilters thefiltering listrules ofto overriddenapply valuesto for every quota type in the result. matching entities * // @param options the options to use // Default: false. * @return result containing DescribeQuotasOptionsall setOmitOverriddenValues(boolean omitOverriddenValues);matching entities } */ public class DescribeEffectiveQuotasResult { DescribeQuotasResult describeQuotas(Collection<QuotaFilter> filters, /**DescribeQuotasOptions options); } |
Code Block |
---|
public *class InformationDescribeEffectiveQuotasOptions about{ a specific quota configuration value. // Whether to include the list */ of overridden values for every quota type in public class Value {the result. // /** // Default: false. * @param sourceDescribeQuotasOptions the entity source for the valuesetOmitOverriddenValues(boolean omitOverriddenValues); } public class DescribeEffectiveQuotasResult { * @param value/** the non-null value * Information about a specific quota configuration */value. */ public Value(Map<QuotaEntity, String> source, Double value); public class Value { public Map<QuotaEntity, String> source(); /** public Double value(); } * @param source the entity source for the value /** * Information@param aboutvalue the non-null value for a quota type. */ public class Entry { Value(Map<QuotaEntity, String> source, Double value); public /**Map<QuotaEntity, String> source(); public *Double @param value(); the active quota value } /** @param overriddenValues all values that are overridden due to* beingInformation lowerabout inthe specificity value for a quota type. */ public class Entry { public Entry(Value value, List<Value> overriddenValues); /** public* Value@param value(); the active quota value public List<Value> overriddenValues(); * @param overriddenValues all values } that are overridden /** due to being lower in specificity * Maps a quota type to its configuration entry.*/ * public Entry(Value value, List<Value> overriddenValues); * Note that if `options.omitInheritedValues` is true, then this configpublic may not map every Value value(); * quotapublic type to an entry. If a key is not contained in the map, then that quota type's valueList<Value> overriddenValues(); } /** * is not specified Maps a quota type to its configuration entry. */ public KafkaFuture<Map<QuotaType, Entry>> config(); } public interface Admin extends AutoCloseable { /** * Describes the effective quotas for the provided entities. * * @param entities the entities to describe the effective quotas for * @param options the options to use * @return the effective quotas for the entities */ DescribeEffectiveQuotasResult describeEffectiveQuotas(Collection<QuotaEntity> entities, DescribeEffectiveQuotasOptions options); } |
...