-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-19625: Consistency of command-line arguments for verifiable producer/consumer #20390
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
Changes from all commits
d2d51fe
211e9c5
3863c85
dc5135e
2aeb62a
f1096ef
17f0878
ad7a696
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -249,7 +249,7 @@ def start_cmd(self, node, idx): | |
| if self.repeating_keys is not None: | ||
| cmd += " --repeating-keys %s " % str(self.repeating_keys) | ||
|
|
||
| cmd += " --producer.config %s" % VerifiableProducer.CONFIG_FILE | ||
| cmd += " --command-config %s" % VerifiableProducer.CONFIG_FILE | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change could break the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. upgrade_test.py will also fail with these changes. cc @JimmyWang6
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| cmd += " 2>> %s | tee -a %s &" % (VerifiableProducer.STDOUT_CAPTURE, VerifiableProducer.STDOUT_CAPTURE) | ||
| return cmd | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -597,7 +597,7 @@ private static ArgumentParser argParser() { | |
| .setDefault("earliest") | ||
| .type(String.class) | ||
| .dest("resetPolicy") | ||
| .help("Set reset policy (must be either 'earliest', 'latest', or 'none'"); | ||
| .help("Set reset policy (must be either 'earliest', 'latest', or 'none')"); | ||
|
|
||
| parser.addArgument("--assignment-strategy") | ||
| .action(store()) | ||
|
|
@@ -611,8 +611,17 @@ private static ArgumentParser argParser() { | |
| .action(store()) | ||
| .required(false) | ||
| .type(String.class) | ||
| .metavar("CONFIG_FILE") | ||
| .help("Consumer config properties file (config options shared with command line parameters will be overridden)."); | ||
| .metavar("CONFIG-FILE") | ||
| .help("(DEPRECATED) Consumer config properties file" + | ||
| "This option will be removed in a future version. Use --command-config instead"); | ||
|
|
||
| parser.addArgument("--command-config") | ||
| .action(store()) | ||
| .required(false) | ||
| .type(String.class) | ||
| .metavar("CONFIG-FILE") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The names of the metavars use a mixture of |
||
| .dest("commandConfigFile") | ||
| .help("Config properties file (config options shared with command line parameters will be overridden)."); | ||
|
|
||
| return parser; | ||
| } | ||
|
|
@@ -622,16 +631,28 @@ public static VerifiableConsumer createFromArgs(ArgumentParser parser, String[] | |
|
|
||
| boolean useAutoCommit = res.getBoolean("useAutoCommit"); | ||
| String configFile = res.getString("consumer.config"); | ||
| String commandConfigFile = res.getString("commandConfigFile"); | ||
| String brokerHostAndPort = res.getString("bootstrapServer"); | ||
|
|
||
| Properties consumerProps = new Properties(); | ||
| if (configFile != null && commandConfigFile != null) { | ||
| throw new ArgumentParserException("Options --consumer.config and --command-config are mutually exclusive.", parser); | ||
| } | ||
| if (configFile != null) { | ||
| System.out.println("Option --consumer.config has been deprecated and will be removed in a future version. Use --command-config instead."); | ||
| try { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a deprecation message here like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm really sorry—I just woke up, so I made a lot of silly typo errors. :( I’ve already addressed all the comments. Thanks for your review.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, not quite. The deprecation message should be printed if the user specified the old |
||
| consumerProps.putAll(Utils.loadProps(configFile)); | ||
| } catch (IOException e) { | ||
| throw new ArgumentParserException(e.getMessage(), parser); | ||
| } | ||
| } | ||
| if (commandConfigFile != null) { | ||
| try { | ||
| consumerProps.putAll(Utils.loadProps(res.getString(commandConfigFile))); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be |
||
| } catch (IOException e) { | ||
| throw new ArgumentParserException(e.getMessage(), parser); | ||
| } | ||
| } | ||
|
|
||
| GroupProtocol groupProtocol = GroupProtocol.of(res.getString("groupProtocol")); | ||
| consumerProps.put(ConsumerConfig.GROUP_PROTOCOL_CONFIG, groupProtocol.name()); | ||
|
|
||
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.
this breaks
consumer_protocol_migration_test.py