kevinrr888 commented on code in PR #5990:
URL: https://github.com/apache/accumulo/pull/5990#discussion_r2566675781
##########
shell/src/main/java/org/apache/accumulo/shell/commands/CreateTableCommand.java:
##########
@@ -150,29 +152,30 @@ public int execute(final String fullCommand, final
CommandLine cl, final Shell s
}
// Copy configuration options if flag was set
+ Map<String,String> srcTableConfig = null;
if (cl.hasOption(createTableOptCopyConfig.getOpt())) {
String srcTable = cl.getOptionValue(createTableOptCopyConfig.getOpt());
if (cl.hasOption(createTableOptExcludeParentProps.getLongOpt())) {
// copy properties, excludes parent properties in configuration
- Map<String,String> tableProps =
+ srcTableConfig =
shellState.getAccumuloClient().tableOperations().getTableProperties(srcTable);
- tableProps.entrySet().stream()
- .filter(entry -> Property.isValidTablePropertyKey(entry.getKey()))
- .forEach(entry -> initProperties.put(entry.getKey(),
entry.getValue()));
} else {
// copy configuration (include parent properties)
- final Map<String,String> configuration =
+ srcTableConfig =
shellState.getAccumuloClient().tableOperations().getConfiguration(srcTable);
- configuration.entrySet().stream()
- .filter(entry -> Property.isValidTablePropertyKey(entry.getKey()))
- .forEach(entry -> initProperties.put(entry.getKey(),
entry.getValue()));
}
+ srcTableConfig.entrySet().stream()
+ .filter(entry -> Property.isValidTablePropertyKey(entry.getKey()))
+ .forEach(entry -> initProperties.put(entry.getKey(),
entry.getValue()));
}
// if no defaults selected, remove, even if copied from configuration or
properties
if (cl.hasOption(createTableNoDefaultIters.getOpt())) {
- Set<String> initialProps =
IteratorConfigUtil.generateInitialTableProperties(true).keySet();
+ // handles if default props were copied over
+ Set<String> initialProps =
IteratorConfigUtil.getInitialTableProperties().keySet();
initialProps.forEach(initProperties::remove);
Review Comment:
I agree. This code was broken before these changes, and using -ndi and -cc
in conjunction is a bit contradictory and confusing anyways.
--
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]