You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Status

Current state: Under Discussion

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

JIRA: here

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

AdminClient::describeConfigs api takes a Collection of ConfigResource objects as argument to get all the configurations of the entities specified. Here is the api signature:

DescribeConfigsResult describeConfigs(Collection<ConfigResource> resources, DescribeConfigsOptions options);

The ConfigResource class is made up of two fields, name (“topic-1”, “broker-1” etc) and type (BROKER, TOPIC etc) of entity.

This admin api in turn call DescribeConfigsRequest kafka api to get the configuration for specified entities. DescribeConfigsRequest api takes a collection of DescribeConfigsResource objects to specify entities whose configuration needs to be fetched. So to make this Kafka API call, AdminClient::describeConfigs converts ConfigResource collection passed to it to a DescribeConfigsResource collection. In addition to name and type of entity whose configuration to get, Kafka DescribeConfigsResource structure also lets users provide ConfigurationKeys, a list of String, which allows users to specify only the configurations that they are interested in. As this information isn’t present in the ConfigResource class, it is set to null when DescribeConfigsResource object is created from it. Here is the code doing this (kafka/KafkaAdminClient.java at b38f6ba5cc989702180f5d5f8e55ba20444ea884 · apache/kafka )

.map(config ->
    new DescribeConfigsRequestData.DescribeConfigsResource()
        .setResourceName(config.name())
        .setResourceType(config.type().id())
        .setConfigurationKeys(null))


This means that all configurations of all the entities specified are returned by Kafka. Then the user of the AdminClient::describeConfigs iterates over the returned list and filters out the configuration keys that they are interested in.

This results in boilerplate code for all users of AdminClient::describeConfigs api, in addition to  being wasteful use of resource. It becomes painful for large clusters where to fetch one configuration of all topics, we need to fetch all configuration of all topics, which can result in huge response.

This is also a usability issue when running kafka-configs command which returns all configurations and then user need to either scan or filter for property that they are interested in.

We need to add same ConfigurationKeys parameter that DescribeConfigsResource takes to AdminClient’s ConfigResource class to bring it 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-configs command line utility so that users of the tool don’t need to fetch all configurations when they are interested in only a few 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

  • Anything else that will likely break existing users in some way when they upgrade

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

  • What impact (if any) will there be on existing users?
  • If we are changing behavior how will we phase out the older behavior?
  • If we need special migration tools, describe them here.
  • When will we remove the existing behavior?

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.

  • No labels