kevinrr888 commented on code in PR #6012:
URL: https://github.com/apache/accumulo/pull/6012#discussion_r2611430717
##########
shell/src/main/java/org/apache/accumulo/shell/commands/CreateTableCommand.java:
##########
@@ -114,8 +117,22 @@ public int execute(final String fullCommand, final
CommandLine cl, final Shell s
+ " only valid when using " + createTableOptCopyConfig.getLongOpt());
}
- if (cl.hasOption(createTableOptCopyConfig.getOpt())) {
- final String oldTable =
cl.getOptionValue(createTableOptCopyConfig.getOpt());
+ for (var copyOpt : copyConfigGroup.getOptions()) {
+ if (cl.hasOption(copyOpt) && (cl.hasOption(createTableNoDefaultIters)
+ || cl.hasOption(createTableNoDefaultTableProps) ||
cl.hasOption(createTableOptInitProp)
+ || cl.hasOption(createTableOptIteratorProps) ||
cl.hasOption(createTableOptFormatter)
+ || cl.hasOption(createTableOptLocalityProps) ||
cl.hasOption(createTableOptEVC))) {
+ throw new IllegalArgumentException(copyOpt.getLongOpt()
+ + " is mutually exclusive with any other option that sets
per-table properties");
+ }
+ }
+
+ if (cl.hasOption(createTableOptCopyConfig.getOpt())
+ || cl.hasOption(createTableOptCopyProps.getOpt())) {
+ String oldTable = cl.getOptionValue(createTableOptCopyConfig.getOpt());
Review Comment:
Was unintentionally using both. Fixed my changes to only pass Option
directly in 9a7102db991351a1f616bcbee4f9e948603a98b6. Could be a follow on to
fix the other instances of getOpt(), but probably not worth the time or risk of
breaking something in 2.1. How it is now is fine
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]