-
Notifications
You must be signed in to change notification settings - Fork 14.6k
KAFKA-19653: Improve metavariable names in usage messages #20438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LGTM. I see the same situation in Agent.java, Coordinator.java, MessageGenerator.java, etc., but it's outside the scope of this KIP. We can improve it in another PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @AndrewJSchofield! I like the switch to dash vs. underscore for readability, though it's subjective.
Are we sticking with the term "messages" over "records?" I'm sure I'm getting mixed up, but I thought there was an effort to switch the tools over to using records.
Thanks!
Thanks @kirktrue. wrt to "messages" vs "records", we prefer "records" in general and are moving in that direction. The verifiable producer/consumer still use "messages" and KIP-1147 didn't include changing those to "records". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM
|
||
parser.addArgument("--command-config") | ||
.action(store()) | ||
.required(false) | ||
.type(String.class) | ||
.dest("commandConfig") | ||
.metavar("CONFIG_FILE") | ||
.metavar("CONFIG-FILE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kafka currently uses two parser libraryies: joptsimple
and argparse4j
. As a result, not all tools support metavariables. I'm not sure why Kafka relies on both parsers, but it would be beneficial to unify them to ensure a consistent codebase and output message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a bit annoying. If we have to choose between the two, we should probably use joptsimple everywhere, since most scripts already rely on CommandDefaultOptions, which works well with CommandLineUtils.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I agree in principle, the syntax supported by kafka-producer-perf-test
is a bit different. We might accidentally cause existing commands to fail. So, care needed here for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have opened https://issues.apache.org/jira/browse/KAFKA-19670
Since argparse4j
provides more powerful features, we could consider using it for the codebase
This trivial PR improves the so-called metavariable names in the usage
messages of the verifiable producer/consumer command-line tools. These
are the names of the replacement variables that appear solely in the
usage messages.
Verifiable producer (before):
(after)
Verifiable consumer (before):
(after)
Verifiable share consumer (before):
(after):
Reviewers: Kirk True [email protected], Ken Huang
[email protected], Lianet Magrans [email protected]