...
This is also a usability issue when kafka-topics
is used with --describe
option and no topic name is provided. We get all configurations of all the topics, where a user may only be interested in only one or few of the configurations. For kafka-topics
command we also need a way to skip getting configuration so that partition information of all topics can be fetched w/o fetching their configurationconfigurations.
We need to a way to specify ConfigurationKeys
parameter that DescribeConfigsResource
takes to bring AdminClient::describeConfigs
api to parity with DescribeConfigsResource
and allow AdminClient’s users to specify configuration keys that they are interested in.
In addition we need to add same option to kafka-topics
command line utility so that users of the tool don’t need to fetch all configurations when they are interested in only a few or none of them.
Public Interfaces
Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed. The purpose of this section is to concisely call out the public contract that will come along with this feature.
A public interface is any change to the following:
...
Binary log format
...
The network protocol and api behavior
...
Any class in the public packages under clientsConfiguration, especially client configuration
org/apache/kafka/common/serialization
org/apache/kafka/common
org/apache/kafka/common/errors
org/apache/kafka/clients/producer
org/apache/kafka/clients/consumer (eventually, once stable)
...
Monitoring
...
Command line tools and arguments
We will modify the DescribeConfigsOptions
argument of the AdminClient::describeConfigs
api to take an additional parameter List<String> configurationKeys
, which will be same as one that the DescribeConfigsResource
takes so that AdminClient::describeConfigs
users can specify configurations to fetch. An empty or null value for this will behave as it behaves today by fetching all configuration values. Here is how the new DescribeConfigsOptions
structure will look like after this change:
Code Block |
---|
@InterfaceStability.Evolving
public class DescribeConfigsOptions extends AbstractOptions<DescribeConfigsOptions> {
private boolean includeSynonyms = false;
private boolean includeDocumentation = false;
private List<String> configurationKeys; // This is the newly introduced field
...
...
public List<String> configurationKeys() {
return configurationKeys;
}
...
...
public void configurationKeys(List<String> configurationKeys) {
this.configurationKeys = configurationKeys;
}
...
} |
In addition to this we propose two changes to the kafka-topics
command line tool :
- Allow
--config
option to be specified when using--describe
option. When used in such a way, only the configuration(s) specified will be fetched for the topic. - Add --partition-only option that when used with
–describe
will skip fetching configuration of the topics and will only return partition information.
...
Proposed Changes
Describe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgement based on the scope of the change.
Compatibility, Deprecation, and Migration Plan
...
There is no compatibility issue as we are adding a new field to an existing data structure (DescribeConfigsOptions
). If the field is not specified then the code will behave in same manner as existing code. The same applies to changes to the kafka-topics
tool, as we are adding new options and existing options will continue to behave as is.
Rejected Alternatives
If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.