public void visit(State state, Properties props) throws Exception {
// reset any previous setting
Object lastSetting = state.getMap().get(LAST_SETTING);
if (lastSetting != null) {
int choice = Integer.parseInt(lastSetting.toString());
Property property = settings[choice].property;
log.debug("Setting " + property.getKey() + " back to " + property.getDefaultValue());
state.getConnector().instanceOperations().setProperty(property.getKey(), property.getDefaultValue());
}
lastSetting = state.getMap().get(LAST_TABLE_SETTING);
if (lastSetting != null) {
String parts[] = lastSetting.toString().split(",");
String table = parts[0];
int choice = Integer.parseInt(parts[1]);
Property property = tableSettings[choice].property;
if (state.getConnector().tableOperations().exists(table)) {
log.debug("Setting " + property.getKey() + " on " + table + " back to " + property.getDefaultValue());
try {
state.getConnector().tableOperations().setProperty(table, property.getKey(), property.getDefaultValue());
} catch (AccumuloException ex) {
if (ex.getCause() instanceof ThriftTableOperationException) {
ThriftTableOperationException ttoe = (ThriftTableOperationException)ex.getCause();
if (ttoe.type == TableOperationExceptionType.NOTFOUND)
return;