ACCUMULO-4469 ConcurrentModificationException while running MultiTable.xml node 
in Random Walk

Signed-off-by: Josh Elser <els...@apache.org>


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

Branch: refs/heads/1.8
Commit: deb5edd8df6161a3ba30a0c83dbc240096c1721e
Parents: d23676d
Author: Dima Spivak <dimaspi...@apache.org>
Authored: Fri Sep 23 12:57:32 2016 -0700
Committer: Josh Elser <els...@apache.org>
Committed: Fri Sep 23 17:55:17 2016 -0400

----------------------------------------------------------------------
 .../apache/accumulo/test/randomwalk/multitable/CopyTable.java | 4 ++--
 .../accumulo/test/randomwalk/multitable/CreateTable.java      | 4 ++--
 .../apache/accumulo/test/randomwalk/multitable/DropTable.java | 4 ++--
 .../test/randomwalk/multitable/MultiTableFixture.java         | 7 ++++---
 .../accumulo/test/randomwalk/multitable/OfflineTable.java     | 4 ++--
 .../org/apache/accumulo/test/randomwalk/multitable/Write.java | 4 ++--
 6 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/deb5edd8/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
----------------------------------------------------------------------
diff --git 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
index d02cb42..0f040b1 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.test.randomwalk.multitable;
 
-import java.util.ArrayList;
+import java.util.List;
 import java.util.Properties;
 import java.util.Random;
 import java.util.TreeSet;
@@ -44,7 +44,7 @@ public class CopyTable extends Test {
   public void visit(State state, Environment env, Properties props) throws 
Exception {
 
     @SuppressWarnings("unchecked")
-    ArrayList<String> tables = (ArrayList<String>) state.get("tableList");
+    List<String> tables = (List<String>) state.get("tableList");
     if (tables.isEmpty())
       return;
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/deb5edd8/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
----------------------------------------------------------------------
diff --git 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
index 27ab09c..84c359b 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.test.randomwalk.multitable;
 
-import java.util.ArrayList;
+import java.util.List;
 import java.util.Properties;
 import java.util.TreeSet;
 
@@ -55,7 +55,7 @@ public class CreateTable extends Test {
       conn.tableOperations().addSplits(tableName, splits);
       log.debug("created " + splits.size() + " splits on " + tableName);
       @SuppressWarnings("unchecked")
-      ArrayList<String> tables = (ArrayList<String>) state.get("tableList");
+      List<String> tables = (List<String>) state.get("tableList");
       tables.add(tableName);
     } catch (TableExistsException e) {
       log.warn("Failed to create " + tableName + " as it already exists");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/deb5edd8/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/DropTable.java
----------------------------------------------------------------------
diff --git 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/DropTable.java
 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/DropTable.java
index 2bbd873..c960ae7 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/DropTable.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/DropTable.java
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.test.randomwalk.multitable;
 
-import java.util.ArrayList;
+import java.util.List;
 import java.util.Properties;
 import java.util.Random;
 
@@ -31,7 +31,7 @@ public class DropTable extends Test {
   public void visit(State state, Environment env, Properties props) throws 
Exception {
 
     @SuppressWarnings("unchecked")
-    ArrayList<String> tables = (ArrayList<String>) state.get("tableList");
+    List<String> tables = (List<String>) state.get("tableList");
 
     // don't drop a table if we only have one table or less
     if (tables.size() <= 1) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/deb5edd8/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
----------------------------------------------------------------------
diff --git 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
index 4d46295..dfa326a 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
@@ -17,7 +17,8 @@
 package org.apache.accumulo.test.randomwalk.multitable;
 
 import java.net.InetAddress;
-import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.MultiTableBatchWriter;
@@ -38,7 +39,7 @@ public class MultiTableFixture extends Fixture {
     state.set("nextId", Integer.valueOf(0));
     state.set("numWrites", Long.valueOf(0));
     state.set("totalWrites", Long.valueOf(0));
-    state.set("tableList", new ArrayList<String>());
+    state.set("tableList", new CopyOnWriteArrayList<String>());
   }
 
   @Override
@@ -59,7 +60,7 @@ public class MultiTableFixture extends Fixture {
     Connector conn = env.getConnector();
 
     @SuppressWarnings("unchecked")
-    ArrayList<String> tables = (ArrayList<String>) state.get("tableList");
+    List<String> tables = (List<String>) state.get("tableList");
 
     for (String tableName : tables) {
       try {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/deb5edd8/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/OfflineTable.java
----------------------------------------------------------------------
diff --git 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/OfflineTable.java
 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/OfflineTable.java
index 90c555b..c9e0629 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/OfflineTable.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/OfflineTable.java
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.test.randomwalk.multitable;
 
-import java.util.ArrayList;
+import java.util.List;
 import java.util.Properties;
 import java.util.Random;
 
@@ -30,7 +30,7 @@ public class OfflineTable extends Test {
   public void visit(State state, Environment env, Properties props) throws 
Exception {
 
     @SuppressWarnings("unchecked")
-    ArrayList<String> tables = (ArrayList<String>) state.get("tableList");
+    List<String> tables = (List<String>) state.get("tableList");
 
     if (tables.size() <= 0) {
       return;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/deb5edd8/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
----------------------------------------------------------------------
diff --git 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
index 494b794..44cf76a 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
@@ -19,7 +19,7 @@ package org.apache.accumulo.test.randomwalk.multitable;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 import java.security.MessageDigest;
-import java.util.ArrayList;
+import java.util.List;
 import java.util.Properties;
 import java.util.Random;
 import java.util.UUID;
@@ -40,7 +40,7 @@ public class Write extends Test {
   public void visit(State state, Environment env, Properties props) throws 
Exception {
 
     @SuppressWarnings("unchecked")
-    ArrayList<String> tables = (ArrayList<String>) state.get("tableList");
+    List<String> tables = (List<String>) state.get("tableList");
 
     if (tables.isEmpty()) {
       log.debug("No tables to ingest into");

Reply via email to