Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
    /**
     * The quota types.
     */
    public enum QuotaType {
        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.
        //
        // Default: false.
        DescribeQuotasOptions setOmitInheritedValues(boolean omitInheritedValues);

        // Whether to include the list of overridden values for every quota type in the result.
        //
        // Default: false.
        DescribeQuotasOptions setOmitOverriddenValues(boolean omitOverriddenValues);
    }

    public class DescribeEffectiveQuotasResult {
        /**
         * Information about a specific quota configuration value.
         */
        public class Value {
            /**
             * @param source the entity source for the value
             * @param value the non-null value
             */
            public Value(Map<QuotaEntity, String> source, Double value);

            public Map<QuotaEntity, String> source();
            public Double value();
        }

        /**
         * Information about the value for a quota type.
         */
        public class Entry {
            /**
             * @param value the active quota value
             * @param overriddenValues all values that are overridden due to being lower in specificity
             */
            public Entry(Value value, List<Value> overriddenValues);

            public Value value();
            public List<Value> overriddenValues();
        }

        /**
         * Maps a quota type to its configuration entry.
         *
         * Note that if `options.omitInheritedValues` is true, then this config may not map every
         * 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.
         */
        DescribeEffectiveQuotasResult describeEffectiveQuotas(Collection<QuotaEntity> quotaEntities,
                                                              DescribeEffectiveQuotasOptions options);
    }


Code Block
    public class AlterQuotasOpAlterQuotasEntry {
        /**
         * @param typeentity the entity whose quotaconfig typewill tobe altermodified
         * @param ops the newalteration valueto forperform the- quota,if otherwisevalue ifis nullset, then the existing value is clearedupdated,
         */            otherwise if null, the existing value is cleared
        public QuotaAlteration(QuotaType type, Double value);AlterQuotasEntry(Map<QuotaEntity, String> entity, Map<QuotaType, Double> ops);

        public QuotaType typeMap<QuotaEntity, String> entity();
        public Map<QuotaType, DoubleDouble> valueops();
    }

    public class AlterQuotasOptions {
        // Default.
    }

    public class AlterQuotasResult {
        /**
         * @return map of a quota entity update to its future
         */
        public Map<QuotaEntityMap<Map<QuotaEntity, String>, KafkaFuture<Void>> futures();
    }

    public interface Admin extends AutoCloseable {
        /**
         * Alters the quotas as specified for the provided quota entitiesentries.
         *
         * @param alterations the alterations to perform
         * @return the result of the alterations
         */
        AlterQuotasResult alterQuotas(Map<QuotaEntityCollection<AlterQuotasEntry> entries, AlterQuotasOp>AlterQuotasOptions alterationsoptions);
    }



Proposed Changes

Compatibility, Deprecation, and Migration Plan

...