accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/2] git commit: ACCUMULO-2090 Add a slightly better exception catching on randomwalk RenameTable
Date Fri, 03 Jan 2014 20:36:47 GMT
Updated Branches:
  refs/heads/master 09247cdd3 -> 8b8c61532


ACCUMULO-2090 Add a slightly better exception catching on randomwalk RenameTable

We know a few things when we catch this exception, but we can't definitely
make assertions about what was correct/incorrect because the namespaces could
be created or deleted while we're running this test. Best we can do is properly log.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/29bdceb4
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/29bdceb4
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/29bdceb4

Branch: refs/heads/master
Commit: 29bdceb4e601ba6ebaaa80e93ef676b4d28b2699
Parents: 4c2652b
Author: Josh Elser <elserj@apache.org>
Authored: Fri Jan 3 14:32:36 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Jan 3 15:36:04 2014 -0500

----------------------------------------------------------------------
 .../test/randomwalk/concurrent/RenameTable.java         | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/29bdceb4/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/RenameTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/RenameTable.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/RenameTable.java
index 6c7516e..d9a12fb 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/RenameTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/RenameTable.java
@@ -22,6 +22,7 @@ import java.util.Random;
 
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.NamespaceNotFoundException;
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.test.randomwalk.State;
@@ -59,6 +60,17 @@ public class RenameTable extends Test {
     } catch (TableExistsException e) {
       log.debug("Rename " + srcTableName + " failed, " + newTableName + " exists");
     } catch (TableNotFoundException e) {
+      Throwable cause = e.getCause();
+      if (null != cause) {
+        // Rename has to have failed on the destination namespace, because the source namespace
+        // couldn't be deleted with our table in it
+        if (cause.getClass().isAssignableFrom(NamespaceNotFoundException.class)) {
+          log.debug("Rename failed because new namespace doesn't exist: " + newNamespace,
cause);
+          // Avoid the final src/dest namespace check
+          return;
+        }
+      }
+      
       log.debug("Rename " + srcTableName + " failed, doesnt exist");
     } catch (IllegalArgumentException e) {
       log.debug("Rename: " + e.toString());


Mime
View raw message