if (cl.hasOption(deleteOpt.getOpt())) {
// delete property from table
String property = cl.getOptionValue(deleteOpt.getOpt());
if (property.contains("="))
throw new BadArgumentException("Invalid '=' operator in delete operation.", fullCommand, fullCommand.indexOf('='));
if (tableName != null) {
if (!Property.isValidTablePropertyKey(property))
log.warn("Invalid per-table property : " + property + ", still removing from zookeeper if its there.");
shellState.connector.tableOperations().removeProperty(tableName, property);
log.debug("Successfully deleted table configuration option.");
} else {
if (!Property.isValidZooPropertyKey(property))
log.warn("Invalid per-table property : " + property + ", still removing from zookeeper if its there.");
shellState.connector.instanceOperations().removeProperty(property);
log.debug("Successfully deleted system configuration option");
}
} else if (cl.hasOption(setOpt.getOpt())) {
// set property on table
String property = cl.getOptionValue(setOpt.getOpt()), value = null;
if (!property.contains("="))
throw new BadArgumentException("Missing '=' operator in set operation.", fullCommand, fullCommand.indexOf(property));
String pair[] = property.split("=", 2);
property = pair[0];
value = pair[1];
if (tableName != null) {
if (!Property.isValidTablePropertyKey(property))
throw new BadArgumentException("Invalid per-table property.", fullCommand, fullCommand.indexOf(property));
if (property.equals(Property.TABLE_DEFAULT_SCANTIME_VISIBILITY.getKey()))
new ColumnVisibility(value); // validate that it is a valid
// expression
shellState.connector.tableOperations().setProperty(tableName, property, value);
log.debug("Successfully set table configuration option.");
} else {
if (!Property.isValidZooPropertyKey(property))
throw new BadArgumentException("Property cannot be modified in zookeeper", fullCommand, fullCommand.indexOf(property));
shellState.connector.instanceOperations().setProperty(property, value);
log.debug("Successfully set system configuration option");
}
} else {