This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.

Status

Current state: Accepted (Voting thread is here)

Discussion thread: here

JIRA: KAFKA-2061

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

Motivation

There is no way to know using Kafka version, but version information is important for developing client application, troubleshooting, etc.

Public Interfaces

All of commands which uses kafka-run-class.sh (such as kafka-topics.sh, kafka-server-start.sh, etc) accepts --version to show version information.

This option shows Kafka version and git commit hash like below:

$ kafka-topics.sh --version
(snip)
2.0.0-SNAPSHOT (Commit:152c8e88cbe00c8b)

These information are gotten from AppInfoParser#getVersion and AppInfoParser#getCommitId.

Proposed Changes

  • Add new class to show version information.
  • Add code to kafka-run-class.sh to realize version option and run this class.

Please check this Pull Requst for details: https://github.com/apache/kafka/pull/639/files

I added some code to kafka-run-class.sh, since this is make easy to maintain each commands.
Kafka commands have each option parsers, but adding version option to each option parser makes hard to maintain when changing command and adding new one.

Compatibility, Deprecation, and Migration Plan

This proposal adds new option to each commands only, so existing users can use all commands w/o changes.

Rejected Alternatives

Adding version option to each command parsers

Kafka's commands have option parser for each. This approach is to update each option parser.
For adding this option to kafka-topic.sh, we should modify TopicCommandOptions class, for example.

Pros

  • show up this option in help describe

Cons

  • need to maintain individually for this option when anyone add and update commands

This problem may be solved by KIP-14 (Tools Standardization).
Some code will be added to kafka-run-class.sh only to add this option in this KIP. It makes easy to adapt KIP-14 because mount of code to be changed is small.
(That this code is only temporary before accepted KIP-14)

Support both single-dash and double-dash option for this option

This means users can use --version and -version to show version information. Both support makes easy to find this option. 

However, tools standardization is under considering in KIP-14 now, and this option may be included.
We considered that it is too hard to keep maintain to support both --version and -version after accepted KIP-14.

 

  • No labels