DomGarguilo commented on code in PR #3146:
URL: https://github.com/apache/accumulo/pull/3146#discussion_r1059461050
##########
shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java:
##########
@@ -127,19 +127,29 @@ public int execute(final String fullCommand, final
CommandLine cl, final Shell s
value = pair[1];
if (tableName != null) {
- if (!Property.isValidTablePropertyKey(property)) {
- throw new BadArgumentException("Invalid per-table property.",
fullCommand,
- fullCommand.indexOf(property));
+ if (!Property.isTablePropertyValid(property, value)) {
+ if (!Property.isValidTablePropertyKey(property)) {
+ throw new BadArgumentException("Invalid per-table property.",
fullCommand,
+ fullCommand.indexOf(property));
+ } else {
+ throw new BadArgumentException("Invalid property value.",
fullCommand,
+ fullCommand.indexOf(value));
+ }
}
if
(property.equals(Property.TABLE_DEFAULT_SCANTIME_VISIBILITY.getKey())) {
new ColumnVisibility(value); // validate that it is a valid
expression
}
shellState.getAccumuloClient().tableOperations().setProperty(tableName,
property, value);
Shell.log.debug("Successfully set table configuration option.");
Review Comment:
It looks like a lot of this code is duplicated in the next `else if` block.
I wonder if it would be worth it to extract some of the logic into a new method
for reuse.
--
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]