From 63f4157811f75cca50ab627980b6ece1f2752612 Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Mon, 22 Jul 2019 15:15:09 -0400 Subject: [PATCH 1/3] Replace Thrift types --- contrib/import-control.xml | 2 -- .../testing/randomwalk/concurrent/Config.java | 27 +++++++------------ 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/contrib/import-control.xml b/contrib/import-control.xml index 60eae350..f94af1ba 100644 --- a/contrib/import-control.xml +++ b/contrib/import-control.xml @@ -37,8 +37,6 @@ - - diff --git a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java b/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java index 33534031..faada0a6 100644 --- a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java +++ b/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java @@ -20,8 +20,7 @@ import java.util.SortedSet; import org.apache.accumulo.core.client.AccumuloException; -import org.apache.accumulo.core.clientImpl.thrift.TableOperationExceptionType; -import org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException; +import org.apache.accumulo.core.client.TableNotFoundException; import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.testing.randomwalk.RandWalkEnv; import org.apache.accumulo.testing.randomwalk.State; @@ -131,10 +130,8 @@ public void visit(State state, RandWalkEnv env, Properties props) throws Excepti env.getAccumuloClient().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; + if (ex.getCause() instanceof TableNotFoundException) { + return; } throw ex; } @@ -153,10 +150,8 @@ public void visit(State state, RandWalkEnv env, Properties props) throws Excepti env.getAccumuloClient().namespaceOperations().setProperty(namespace, property.getKey(), property.getDefaultValue()); } catch (AccumuloException ex) { - if (ex.getCause() instanceof ThriftTableOperationException) { - ThriftTableOperationException ttoe = (ThriftTableOperationException) ex.getCause(); - if (ttoe.type == TableOperationExceptionType.NAMESPACE_NOTFOUND) - return; + if (ex.getCause() instanceof TableNotFoundException) { + return; } throw ex; } @@ -197,10 +192,8 @@ private void changeTableSetting(RandomDataGenerator random, State state, RandWal env.getAccumuloClient().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; + if (ex.getCause() instanceof TableNotFoundException) { + return; } throw ex; } @@ -228,10 +221,8 @@ private void changeNamespaceSetting(RandomDataGenerator random, State state, Ran env.getAccumuloClient().namespaceOperations().setProperty(namespace, setting.property.getKey(), "" + newValue); } catch (AccumuloException ex) { - if (ex.getCause() instanceof ThriftTableOperationException) { - ThriftTableOperationException ttoe = (ThriftTableOperationException) ex.getCause(); - if (ttoe.type == TableOperationExceptionType.NAMESPACE_NOTFOUND) - return; + if (ex.getCause() instanceof TableNotFoundException) { + return; } throw ex; } From 6a87136b231148740a80bce03c1db4ba72ed0811 Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Mon, 22 Jul 2019 18:00:28 -0400 Subject: [PATCH 2/3] PR updates --- .../apache/accumulo/testing/randomwalk/concurrent/Config.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java b/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java index faada0a6..bfa937fc 100644 --- a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java +++ b/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java @@ -20,6 +20,7 @@ import java.util.SortedSet; import org.apache.accumulo.core.client.AccumuloException; +import org.apache.accumulo.core.client.NamespaceNotFoundException; import org.apache.accumulo.core.client.TableNotFoundException; import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.testing.randomwalk.RandWalkEnv; @@ -150,7 +151,7 @@ public void visit(State state, RandWalkEnv env, Properties props) throws Excepti env.getAccumuloClient().namespaceOperations().setProperty(namespace, property.getKey(), property.getDefaultValue()); } catch (AccumuloException ex) { - if (ex.getCause() instanceof TableNotFoundException) { + if (ex.getCause() instanceof NamespaceNotFoundException) { return; } throw ex; From f1afb886b76efeb5e5a0608e19b6a590a7555e50 Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Tue, 23 Jul 2019 17:10:20 -0400 Subject: [PATCH 3/3] Fix --- .../apache/accumulo/testing/randomwalk/concurrent/Config.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java b/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java index bfa937fc..b209d33d 100644 --- a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java +++ b/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Config.java @@ -222,7 +222,7 @@ private void changeNamespaceSetting(RandomDataGenerator random, State state, Ran env.getAccumuloClient().namespaceOperations().setProperty(namespace, setting.property.getKey(), "" + newValue); } catch (AccumuloException ex) { - if (ex.getCause() instanceof TableNotFoundException) { + if (ex.getCause() instanceof NamespaceNotFoundException) { return; } throw ex;