accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1451664 - /accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
Date Fri, 01 Mar 2013 17:45:41 GMT
Author: ecn
Date: Fri Mar  1 17:45:41 2013
New Revision: 1451664

URL: http://svn.apache.org/r1451664
Log:
ACCUMULO-1115 handle table deleted exception

Modified:
    accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java

Modified: accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java?rev=1451664&r1=1451663&r2=1451664&view=diff
==============================================================================
--- accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
(original)
+++ accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
Fri Mar  1 17:45:41 2013
@@ -19,6 +19,9 @@ package org.apache.accumulo.test.randomw
 import java.util.Properties;
 import java.util.SortedSet;
 
+import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.impl.thrift.TableOperationExceptionType;
+import org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
@@ -140,7 +143,16 @@ public class Config extends Test {
     long newValue = random.nextLong(setting.min, setting.max);
     state.getMap().put(LAST_TABLE_SETTING, table + "," + choice);
     log.debug("Setting " + setting.property.getKey() + " on table " + table + " to " + newValue);
-    state.getConnector().tableOperations().setProperty(table, setting.property.getKey(),
"" + newValue);
+    try {
+      state.getConnector().tableOperations().setProperty(table, setting.property.getKey(),
"" + newValue);
+    } catch (AccumuloException ex) {
+      if (ex.getCause() instanceof ThriftTableOperationException) {
+        ThriftTableOperationException ttoe = (ThriftTableOperationException)ex.getCause();
+        if (ttoe.type == TableOperationExceptionType.NOTFOUND)
+          return;
+      }
+      throw ex;
+    }
   }
   
   private void changeSetting(RandomData random, State state, Properties props) throws Exception
{



Mime
View raw message