ddanielr commented on code in PR #3146:
URL: https://github.com/apache/accumulo/pull/3146#discussion_r1070184250


##########
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:
   Yes, extracting this out to another method cleaned up a good bit of the 
if/else logic in the "set operation" block.



-- 
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]

Reply via email to