KIP-546 (1/2): Implements describeClientQuotas() and alterClientQuotas().#8083
KIP-546 (1/2): Implements describeClientQuotas() and alterClientQuotas().#8083cmccabe merged 6 commits intoapache:trunkfrom
Conversation
|
|
I don't remember discussing reserving a special string for default values. It seems like treating default as null, and then maybe printing it out in a special way in the What is an "unspecified entity type"? Is it the same as a default? Seems like we don't need angle brackets here, since the quota filter type names are ours to choose. |
Done.
The default string "" is currently defined in DynamicConfigManager$ConfigEntityType, and is used for storing the configs under ZK ("" is reserved for this purpose), so I chose to keep it the same. I can make it null, but chose to use "" to keep it consistent with the filters. For filters, the rules are:
It's a bit of a mess, but unfortunately necessary. Let me know if you prefer I name things differently. |
There was a problem hiding this comment.
Can we use Optional<String> for this? Using magic string values feels messy, and will leak into the API
There was a problem hiding this comment.
I'd really rather not see the double equals used with strings. I know Scala has special semantics for this, but it always looks wrong to people familiar with Java. Maybe test isEmpty instead?
There was a problem hiding this comment.
If it's not supported, it shouldn't silently return incorrect data. It should throw an UnsupportedVersionException
There was a problem hiding this comment.
Need to update this JavaDoc parameter to match the new name of the function parameter.
|
I think we can have DescribeQuotasOptions contain a "filter mode" that determines if the supplied filters are treated as "AND" or as "OR". So maybe: What do you think? I think this is clearer than the boolean we had there earlier. I don't understand How do I filter to see just quotas on the default user (or default client id, etc.)? If we're going to use a constant for this, it should be in QuotaFilter somewhere, I think. Or we could use a factory function, I guess. |
Perhaps think of matchNone as matchUnspecified. So maybe it should be either matchSpecified/matchUnspecified, or matchSome/matchNone. So {matchExact(user=foo), matchNone(client-id)} would return just {user=foo}, or alternatively {matchNone(client-id)} would return all users with no client ID provided. To see quotas on default users, you'd do matchExact(user=QuoteEntity.USER_DEFAULT). I can move this to QuotaFilter, but the issue is that they're really specific to the entity type, i.e. not all entity types may contain a default value. I don't believe AND/OR is able to handle unspecified types when they're present. OR seems useful within the same entity type, not so much across entity types. I'm not entirely sold on this approach, I'll give it some thought. |
…s(). Implements describeClientQuotas() and alterClientQuotas() to match current functionality, i.e. extensible entity types and other new quotas features like resolving quotas is not yet supported. This is the minimal functionality necessary for KIP-500, and converts the ConfigCommand to use the client quotas APIs.
|
LGTM. Thanks, @bdbyrne. I think this slightly modified API is a lot more intuitive. Can you update the KIP to reflect the small changes here, and post to the mailing list? |
* apache-github/trunk: (39 commits) MINOR: cleanup and add tests to StateDirectoryTest (apache#8304) HOTFIX: StateDirectoryTest should use Set instead of List (apache#8305) MINOR: Fix build and JavaDoc warnings (apache#8291) MINOR: Fix kafka.server.RequestQuotaTest missing new ApiKeys. (apache#8302) KAFKA-9712: Catch and handle exception thrown by reflections scanner (apache#8289) KAFKA-9670; Reduce allocations in Metadata Response preparation (apache#8236) MINOR: fix Scala 2.13 build error introduced in apache#8083 (apache#8301) MINOR: enforce non-negative invariant for checkpointed offsets (apache#8297) MINOR: comment apikey types in generated switch (apache#8201) MINOR: Fix typo in CreateTopicsResponse.json (apache#8300) KIP-546: Implement describeClientQuotas and alterClientQuotas. (apache#8083) KAFKA-6647: Do note delete the lock file while holding the lock (apache#8267) KAFKA-9677: Fix consumer fetch with small consume bandwidth quotas (apache#8290) KAFKA-9533: Fix JavaDocs of KStream.transformValues (apache#8298) MINOR: reuse pseudo-topic in FKJoin (apache#8296) KAFKA-6145: Pt 2. Include offset sums in subscription (apache#8246) KAFKA-9714; Eliminate unused reference to IBP in `TransactionStateManager` (apache#8293) KAFKA-9718; Don't log passwords for AlterConfigs in request logs (apache#8294) KAFKA-8768: DeleteRecords request/response automated protocol (apache#7957) KAFKA-9685: Solve Set concatenation perf issue in AclAuthorizer ...
…d alterClientQuotas. (apache#8083) Reviewers: Colin P. McCabe <cmccabe@apache.org>
…ed in apache#8083 (apache#8301) Reviewers: Colin P. McCabe <cmccabe@apache.org>, Brian Byrne <bbyrne@confluent.io>
Implements describeClientQuotas() and alterClientQuotas() to match current
functionality, i.e. extensible entity types and other new quotas features
like resolving quotas is not yet supported.
This is the minimal functionality necessary for KIP-500, and converts the
ConfigCommand to use the client quotas APIs. resolveClientQuotas() and the
corresponding client quotas command will be in a future PR.
Committer Checklist (excluded from commit message)