chia7712 commented on code in PR #16964: URL: https://github.com/apache/kafka/pull/16964#discussion_r1760195131
########## tools/src/main/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommandOptions.java: ########## @@ -83,6 +84,13 @@ public ReassignPartitionsCommandOptions(String[] args) { .withRequiredArg() .describedAs("brokerlist") .ofType(String.class); + + bootstrapControllerOpt = parser.accepts("bootstrap-controller", "The controller to use for reassignment. " + + "By default, the tool will get the quorum controller.") Review Comment: Please add the supported actions to the docs ########## tools/src/main/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommand.java: ########## @@ -129,7 +129,12 @@ public static void main(String[] args) { Properties props = opts.options.has(opts.commandConfigOpt) ? Utils.loadProps(opts.options.valueOf(opts.commandConfigOpt)) : new Properties(); - props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, opts.options.valueOf(opts.bootstrapServerOpt)); + validateBootstrapControllerNotSupportedAction(opts); Review Comment: Could you please move this to `validateAndParseArgs`? ########## tools/src/main/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommand.java: ########## @@ -151,6 +156,14 @@ public static void main(String[] args) { } } + private static void validateBootstrapControllerNotSupportedAction(ReassignPartitionsCommandOptions opts) { + if (opts.options.has(opts.bootstrapControllerOpt)) { + if (opts.options.has(opts.verifyOpt) || opts.options.has(opts.executeOpt) || opts.options.has(opts.generateOpt)) { + throw new UnsupportedOperationException("The --bootstrap-controller option is not supported with these action."); Review Comment: Could you please add the unsupported actions to the comment? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org