accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhava...@apache.org
Subject [3/3] git commit: ACCUMULO-841 Refactor randomwalk State class
Date Mon, 24 Feb 2014 16:01:34 GMT
ACCUMULO-841 Refactor randomwalk State class

* Create new Environment object, separate from State, for config props and client objects
* Update most randomwalk test nodes and framework to use Environment
* Eliminate State visit counting, which is unused and redundant with Module's maxHops
* Move getMapReduceJars() method to Node
* Move getPid() method out of State
* Eliminate getCredentials() which ends up not useful
* Reduce visibility to several methods in State and Environment


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

Branch: refs/heads/master
Commit: a74f392ea834923b47bf338bbcd8d6484bd02e6f
Parents: 2563b14
Author: Bill Havanki <bhavanki@cloudera.com>
Authored: Wed Feb 5 08:48:14 2014 -0500
Committer: Bill Havanki <bhavanki@cloudera.com>
Committed: Mon Feb 24 10:57:30 2014 -0500

----------------------------------------------------------------------
 .../accumulo/test/randomwalk/Environment.java   | 216 +++++++++++++++++++
 .../accumulo/test/randomwalk/Fixture.java       |   4 +-
 .../accumulo/test/randomwalk/Framework.java     |  13 +-
 .../apache/accumulo/test/randomwalk/Module.java |  22 +-
 .../apache/accumulo/test/randomwalk/Node.java   |  37 +++-
 .../apache/accumulo/test/randomwalk/State.java  | 197 ++++++-----------
 .../test/randomwalk/bulk/BulkMinusOne.java      |   5 +-
 .../test/randomwalk/bulk/BulkPlusOne.java       |   9 +-
 .../accumulo/test/randomwalk/bulk/BulkTest.java |   7 +-
 .../accumulo/test/randomwalk/bulk/Compact.java  |   5 +-
 .../test/randomwalk/bulk/ConsistencyCheck.java  |   9 +-
 .../accumulo/test/randomwalk/bulk/Merge.java    |   5 +-
 .../accumulo/test/randomwalk/bulk/Setup.java    |   7 +-
 .../accumulo/test/randomwalk/bulk/Split.java    |   5 +-
 .../accumulo/test/randomwalk/bulk/Verify.java   |  11 +-
 .../test/randomwalk/concurrent/AddSplits.java   |   5 +-
 .../test/randomwalk/concurrent/Apocalypse.java  |   3 +-
 .../test/randomwalk/concurrent/BatchScan.java   |   5 +-
 .../test/randomwalk/concurrent/BatchWrite.java  |   5 +-
 .../test/randomwalk/concurrent/BulkImport.java  |   5 +-
 .../concurrent/ChangeAuthorizations.java        |   5 +-
 .../concurrent/ChangePermissions.java           |   5 +-
 .../randomwalk/concurrent/CheckBalance.java     |   5 +-
 .../randomwalk/concurrent/CheckPermission.java  |   5 +-
 .../test/randomwalk/concurrent/CloneTable.java  |   5 +-
 .../test/randomwalk/concurrent/Compact.java     |   5 +-
 .../concurrent/ConcurrentFixture.java           |   5 +-
 .../test/randomwalk/concurrent/Config.java      |  53 ++---
 .../randomwalk/concurrent/CreateNamespace.java  |   5 +-
 .../test/randomwalk/concurrent/CreateTable.java |   5 +-
 .../test/randomwalk/concurrent/CreateUser.java  |   5 +-
 .../randomwalk/concurrent/DeleteNamespace.java  |   5 +-
 .../test/randomwalk/concurrent/DeleteRange.java |   5 +-
 .../test/randomwalk/concurrent/DeleteTable.java |   5 +-
 .../test/randomwalk/concurrent/DropUser.java    |   5 +-
 .../randomwalk/concurrent/IsolatedScan.java     |   5 +-
 .../test/randomwalk/concurrent/ListSplits.java  |   5 +-
 .../test/randomwalk/concurrent/Merge.java       |   5 +-
 .../randomwalk/concurrent/OfflineTable.java     |   5 +-
 .../randomwalk/concurrent/RenameNamespace.java  |   5 +-
 .../test/randomwalk/concurrent/RenameTable.java |   5 +-
 .../test/randomwalk/concurrent/ScanTable.java   |   5 +-
 .../test/randomwalk/concurrent/Setup.java       |   3 +-
 .../test/randomwalk/concurrent/Shutdown.java    |   5 +-
 .../test/randomwalk/concurrent/StartAll.java    |   3 +-
 .../randomwalk/concurrent/StopTabletServer.java |   5 +-
 .../test/randomwalk/conditional/Compact.java    |   7 +-
 .../test/randomwalk/conditional/Flush.java      |   5 +-
 .../test/randomwalk/conditional/Init.java       |   5 +-
 .../test/randomwalk/conditional/Merge.java      |   5 +-
 .../test/randomwalk/conditional/Setup.java      |   9 +-
 .../test/randomwalk/conditional/Split.java      |   5 +-
 .../test/randomwalk/conditional/TearDown.java   |   3 +-
 .../test/randomwalk/conditional/Transfer.java   |   5 +-
 .../test/randomwalk/conditional/Utils.java      |   2 +-
 .../test/randomwalk/conditional/Verify.java     |   7 +-
 .../accumulo/test/randomwalk/image/Commit.java  |   5 +-
 .../test/randomwalk/image/ImageFixture.java     |  19 +-
 .../test/randomwalk/image/ScanMeta.java         |   5 +-
 .../accumulo/test/randomwalk/image/TableOp.java |   5 +-
 .../accumulo/test/randomwalk/image/Verify.java  |   5 +-
 .../accumulo/test/randomwalk/image/Write.java   |   5 +-
 .../test/randomwalk/multitable/Commit.java      |   5 +-
 .../test/randomwalk/multitable/CopyTable.java   |  19 +-
 .../test/randomwalk/multitable/CreateTable.java |   7 +-
 .../test/randomwalk/multitable/DropTable.java   |   5 +-
 .../multitable/MultiTableFixture.java           |  15 +-
 .../randomwalk/multitable/OfflineTable.java     |   7 +-
 .../test/randomwalk/multitable/Write.java       |   5 +-
 .../randomwalk/security/AlterSystemPerm.java    |   9 +-
 .../test/randomwalk/security/AlterTable.java    |  23 +-
 .../randomwalk/security/AlterTablePerm.java     |  47 ++--
 .../test/randomwalk/security/Authenticate.java  |  19 +-
 .../test/randomwalk/security/ChangePass.java    |  25 +--
 .../test/randomwalk/security/CreateTable.java   |  19 +-
 .../test/randomwalk/security/CreateUser.java    |  17 +-
 .../test/randomwalk/security/DropTable.java     |  33 +--
 .../test/randomwalk/security/DropUser.java      |  17 +-
 .../randomwalk/security/SecurityFixture.java    |  49 ++---
 .../randomwalk/security/SecurityHelper.java     |   1 +
 .../test/randomwalk/security/SetAuths.java      |  25 +--
 .../test/randomwalk/security/TableOp.java       |  57 ++---
 .../test/randomwalk/security/Validate.java      |  33 +--
 .../randomwalk/security/WalkingSecurity.java    |  15 +-
 .../test/randomwalk/sequential/BatchVerify.java |   5 +-
 .../test/randomwalk/sequential/Commit.java      |   5 +-
 .../randomwalk/sequential/MapRedVerify.java     |  17 +-
 .../sequential/SequentialFixture.java           |  19 +-
 .../test/randomwalk/sequential/Write.java       |   5 +-
 .../test/randomwalk/shard/BulkInsert.java       |  21 +-
 .../test/randomwalk/shard/CloneIndex.java       |   7 +-
 .../accumulo/test/randomwalk/shard/Commit.java  |   5 +-
 .../test/randomwalk/shard/CompactFilter.java    |   9 +-
 .../accumulo/test/randomwalk/shard/Delete.java  |  11 +-
 .../test/randomwalk/shard/DeleteSomeDocs.java   |   7 +-
 .../test/randomwalk/shard/DeleteWord.java       |  13 +-
 .../test/randomwalk/shard/ExportIndex.java      |  27 +--
 .../accumulo/test/randomwalk/shard/Flush.java   |   5 +-
 .../accumulo/test/randomwalk/shard/Grep.java    |   7 +-
 .../accumulo/test/randomwalk/shard/Insert.java  |   7 +-
 .../accumulo/test/randomwalk/shard/Merge.java   |  11 +-
 .../accumulo/test/randomwalk/shard/Reindex.java |   9 +-
 .../accumulo/test/randomwalk/shard/Search.java  |  11 +-
 .../test/randomwalk/shard/ShardFixture.java     |  23 +-
 .../accumulo/test/randomwalk/shard/Split.java   |   5 +-
 .../test/randomwalk/shard/VerifyIndex.java      |  11 +-
 .../test/randomwalk/unit/CreateTable.java       |   3 +-
 .../test/randomwalk/unit/DeleteTable.java       |   3 +-
 .../accumulo/test/randomwalk/unit/Ingest.java   |   3 +-
 .../accumulo/test/randomwalk/unit/Scan.java     |   3 +-
 .../accumulo/test/randomwalk/unit/Verify.java   |   3 +-
 111 files changed, 915 insertions(+), 638 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
new file mode 100644
index 0000000..3e19bed
--- /dev/null
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
@@ -0,0 +1,216 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.test.randomwalk;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import java.lang.management.ManagementFactory;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.BatchWriterConfig;
+import org.apache.accumulo.core.client.ClientConfiguration;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.Instance;
+import org.apache.accumulo.core.client.MultiTableBatchWriter;
+import org.apache.accumulo.core.client.ZooKeeperInstance;
+import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.accumulo.core.security.Credentials;
+import org.apache.log4j.Logger;
+
+/**
+ * The test environment that is available for randomwalk tests. This includes configuration properties that are available to any randomwalk test and facilities
+ * for creating client-side objects. This class is not thread-safe.
+ */
+public class Environment {
+  /**
+   * The configuration property key for a username.
+   */
+  public static final String KEY_USERNAME = "USERNAME";
+  /**
+   * The configuration property key for a password.
+   */
+  public static final String KEY_PASSWORD = "PASSWORD";
+  /**
+   * The configuration property key for the instance name.
+   */
+  public static final String KEY_INSTANCE = "INSTANCE";
+  /**
+   * The configuration property key for the comma-separated list of ZooKeepers.
+   */
+  public static final String KEY_ZOOKEEPERS = "ZOOKEEPERS";
+  /**
+   * The configuration property key for the maximum memory for the multi-table batch writer.
+   */
+  public static final String KEY_MAX_MEM = "MAX_MEM";
+  /**
+   * The configuration property key for the maximum latency, in milliseconds, for the multi-table batch writer.
+   */
+  public static final String KEY_MAX_LATENCY = "MAX_LATENCY";
+  /**
+   * The configuration property key for the number of write threads for the multi-table batch writer.
+   */
+  public static final String KEY_NUM_THREADS = "NUM_THREADS";
+
+  private static final Logger log = Logger.getLogger(Environment.class);
+
+  private final Properties p;
+  private Instance instance = null;
+  private Connector connector = null;
+  private MultiTableBatchWriter mtbw = null;
+
+  /**
+   * Creates a new test environment.
+   * 
+   * @param p
+   *          configuration properties
+   * @throws NullPointerException
+   *           if p is null
+   */
+  Environment(Properties p) {
+    checkNotNull(p);
+    this.p = p;
+  }
+
+  /**
+   * Gets a copy of the configuration properties.
+   * 
+   * @return a copy of the configuration properties
+   */
+  Properties copyConfigProperties() {
+    return new Properties(p);
+  }
+
+  /**
+   * Gets a configuration property.
+   * 
+   * @param key
+   *          key
+   * @return property value
+   */
+  public String getConfigProperty(String key) {
+    return p.getProperty(key);
+  }
+
+  /**
+   * Gets the configured username.
+   * 
+   * @return username
+   */
+  public String getUserName() {
+    return p.getProperty(KEY_USERNAME);
+  }
+
+  /**
+   * Gets the configured password.
+   * 
+   * @return password
+   */
+  public String getPassword() {
+    return p.getProperty(KEY_PASSWORD);
+  }
+
+  /**
+   * Gets this process's ID.
+   *
+   * @return pid
+   */
+  public String getPid() {
+    return ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
+  }
+
+  /**
+   * Gets an authentication token based on the configured password.
+   * 
+   * @return authentication token
+   */
+  public AuthenticationToken getToken() {
+    return new PasswordToken(getPassword());
+  }
+
+  /**
+   * Gets an Accumulo instance object. The same instance is reused after the first call.
+   * 
+   * @return instance
+   */
+  public Instance getInstance() {
+    if (instance == null) {
+      String instance = p.getProperty(KEY_INSTANCE);
+      String zookeepers = p.getProperty(KEY_ZOOKEEPERS);
+      this.instance = new ZooKeeperInstance(new ClientConfiguration().withInstance(instance).withZkHosts(zookeepers));
+    }
+    return instance;
+  }
+
+  /**
+   * Gets an Accumulo connector. The same connector is reused after the first call.
+   * 
+   * @return connector
+   * @throws AccumuloException
+   * @throws AccumuloSecurityException
+   */
+  public Connector getConnector() throws AccumuloException, AccumuloSecurityException {
+    if (connector == null) {
+      connector = getInstance().getConnector(getUserName(), getToken());
+    }
+    return connector;
+  }
+
+  /**
+   * Gets a multitable batch writer. The same object is reused after the first call unless it is reset.
+   * 
+   * @return multitable batch writer
+   * @throws NumberFormatException
+   *           if any of the numeric batch writer configuration properties cannot be parsed
+   * @throws AccumuloException
+   * @throws AccumuloSecurityException
+   * @throws NumberFormatException
+   *           if any configuration property cannot be parsed
+   */
+  public MultiTableBatchWriter getMultiTableBatchWriter() throws AccumuloException, AccumuloSecurityException {
+    if (mtbw == null) {
+      long maxMem = Long.parseLong(p.getProperty(KEY_MAX_MEM));
+      long maxLatency = Long.parseLong(p.getProperty(KEY_MAX_LATENCY));
+      int numThreads = Integer.parseInt(p.getProperty(KEY_NUM_THREADS));
+      mtbw = getConnector().createMultiTableBatchWriter(
+          new BatchWriterConfig().setMaxMemory(maxMem).setMaxLatency(maxLatency, TimeUnit.MILLISECONDS).setMaxWriteThreads(numThreads));
+    }
+    return mtbw;
+  }
+
+  /**
+   * Checks if a multitable batch writer has been created by this wrapper.
+   * 
+   * @return true if multitable batch writer is already created
+   */
+  public boolean isMultiTableBatchWriterInitialized() {
+    return mtbw != null;
+  }
+
+  /**
+   * Clears the multitable batch writer previously created and remembered by this wrapper.
+   */
+  public void resetMultiTableBatchWriter() {
+    if (mtbw == null)
+      return;
+    if (!mtbw.isClosed()) {
+      log.warn("Setting non-closed MultiTableBatchWriter to null (leaking resources)");
+    }
+    mtbw = null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/Fixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Fixture.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Fixture.java
index 73b51d2..3f18201 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Fixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Fixture.java
@@ -22,7 +22,7 @@ public abstract class Fixture {
   
   protected final Logger log = Logger.getLogger(this.getClass());
   
-  public abstract void setUp(State state) throws Exception;
+  public abstract void setUp(State state, Environment env) throws Exception;
   
-  public abstract void tearDown(State state) throws Exception;
+  public abstract void tearDown(State state, Environment env) throws Exception;
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/Framework.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Framework.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Framework.java
index 9d01929..56fb366 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Framework.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Framework.java
@@ -40,10 +40,6 @@ public class Framework {
     return INSTANCE;
   }
   
-  public String getConfigDir() {
-    return configDir;
-  }
-  
   public void setConfigDir(String confDir) {
     configDir = confDir;
   }
@@ -56,13 +52,13 @@ public class Framework {
    * @param state
    * @param confDir
    */
-  public int run(String startName, State state, String confDir) {
+  public int run(String startName, State state, Environment env, String confDir) {
     
     try {
       System.out.println("confDir " + confDir);
       setConfigDir(confDir);
       Node node = getNode(startName);
-      node.visit(state, new Properties());
+      node.visit(state, env, new Properties());
     } catch (Exception e) {
       log.error("Error during random walk", e);
       return -1;
@@ -121,8 +117,9 @@ public class Framework {
     
     DOMConfigurator.configure(opts.configDir + "logger.xml");
     
-    State state = new State(props);
-    int retval = getInstance().run(opts.module, state, opts.configDir);
+    State state = new State();
+    Environment env = new Environment(props);
+    int retval = getInstance().run(opts.module, state, env, opts.configDir);
     
     System.exit(retval);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
index 2568480..b7f64ba 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
@@ -56,7 +56,7 @@ public class Module extends Node {
     }
     
     @Override
-    public void visit(State state, Properties props) {
+    public void visit(State state, Environment env, Properties props) {
       String print;
       if ((print = props.getProperty("print")) != null) {
         Level level = Level.toLevel(print);
@@ -81,7 +81,7 @@ public class Module extends Node {
     }
     
     @Override
-    public void visit(State state, Properties props) throws Exception {
+    public void visit(State state, Environment env, Properties props) throws Exception {
       throw new Exception("You don't visit aliases!");
     }
     
@@ -168,7 +168,7 @@ public class Module extends Node {
   }
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     int maxHops, maxSec;
     boolean teardown;
     
@@ -191,7 +191,7 @@ public class Module extends Node {
       teardown = false;
     
     if (fixture != null) {
-      fixture.setUp(state);
+      fixture.setUp(state, env);
     }
     
     Node initNode = getNode(initNodeId);
@@ -201,11 +201,10 @@ public class Module extends Node {
       startTimer(initNode);
       test = true;
     }
-    initNode.visit(state, getProps(initNodeId));
+    initNode.visit(state, env, getProps(initNodeId));
     if (test)
       stopTimer(initNode);
     
-    state.visitedNode();
     // update aliases
     Set<String> aliases;
     if ((aliases = aliasMap.get(initNodeId)) != null)
@@ -252,18 +251,18 @@ public class Module extends Node {
           startTimer(nextNode);
           test = true;
         }
-        nextNode.visit(state, nodeProps);
+        nextNode.visit(state, env, nodeProps);
         if (test)
           stopTimer(nextNode);
       } catch (Exception e) {
-        log.debug("Connector belongs to user: " + state.getConnector().whoami());
+        log.debug("Connector belongs to user: " + env.getConnector().whoami());
         log.debug("Exception occured at: " + System.currentTimeMillis());
         log.debug("Properties for node: " + nextNodeId);
         for (Entry<Object,Object> entry : nodeProps.entrySet()) {
           log.debug("  " + entry.getKey() + ": " + entry.getValue());
         }
-        log.debug("Overall Properties");
-        for (Entry<Object,Object> entry : state.getProperties().entrySet()) {
+        log.debug("Overall Configuration Properties");
+        for (Entry<Object,Object> entry : env.copyConfigProperties().entrySet()) {
           log.debug("  " + entry.getKey() + ": " + entry.getValue());
         }
         log.debug("State information");
@@ -285,7 +284,6 @@ public class Module extends Node {
         }
         throw new Exception("Error running node " + nextNodeId, e);
       }
-      state.visitedNode();
       
       // update aliases
       if ((aliases = aliasMap.get(curNodeId)) != null)
@@ -298,7 +296,7 @@ public class Module extends Node {
     
     if (teardown && (fixture != null)) {
       log.debug("tearing down module");
-      fixture.tearDown(state);
+      fixture.tearDown(state, env);
     }
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/Node.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Node.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Node.java
index 1868ade..980c608 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Node.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Node.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.test.randomwalk;
 
+import java.io.File;
 import java.util.Properties;
 
 import org.apache.log4j.Logger;
@@ -33,9 +34,11 @@ public abstract class Node {
    * 
    * @param state
    *          Random walk state passed between nodes
+   * @param env
+   *          test environment
    * @throws Exception
    */
-  public abstract void visit(State state, Properties props) throws Exception;
+  public abstract void visit(State state, Environment env, Properties props) throws Exception;
   
   @Override
   public boolean equals(Object o) {
@@ -61,4 +64,36 @@ public abstract class Node {
   synchronized public long lastProgress() {
     return progress;
   }
+
+  protected String getMapReduceJars() {
+
+    String acuHome = System.getenv("ACCUMULO_HOME");
+    String zkHome = System.getenv("ZOOKEEPER_HOME");
+
+    if (acuHome == null || zkHome == null) {
+      throw new RuntimeException("ACCUMULO or ZOOKEEPER home not set!");
+    }
+
+    String retval = null;
+
+    File zkLib = new File(zkHome);
+    String[] files = zkLib.list();
+    for (int i = 0; i < files.length; i++) {
+      String f = files[i];
+      if (f.matches("^zookeeper-.+jar$")) {
+        if (retval == null) {
+          retval = String.format("%s/%s", zkLib.getAbsolutePath(), f);
+        } else {
+          retval += String.format(",%s/%s", zkLib.getAbsolutePath(), f);
+        }
+      }
+    }
+
+    File libdir = new File(acuHome + "/lib");
+    for (String jar : "accumulo-core accumulo-server-base accumulo-fate accumulo-trace libthrift".split(" ")) {
+      retval += String.format(",%s/%s.jar", libdir.getAbsolutePath(), jar);
+    }
+
+    return retval;
+  }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
index f4102ab..6eb2568 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
@@ -16,65 +16,48 @@
  */
 package org.apache.accumulo.test.randomwalk;
 
-import java.io.File;
-import java.lang.management.ManagementFactory;
 import java.util.HashMap;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.ClientConfiguration;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.Instance;
-import org.apache.accumulo.core.client.MultiTableBatchWriter;
-import org.apache.accumulo.core.client.ZooKeeperInstance;
-import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
-import org.apache.accumulo.core.client.security.tokens.PasswordToken;
-import org.apache.accumulo.core.security.Credentials;
-import org.apache.log4j.Logger;
 
+/**
+ * A structure for storing state kept during a test. This class is not
+ * thread-safe.
+ */
 public class State {
 
-  private static final Logger log = Logger.getLogger(State.class);
   private HashMap<String,Object> stateMap = new HashMap<String,Object>();
-  private Properties props;
-  private int numVisits = 0;
-  private int maxVisits = Integer.MAX_VALUE;
-
-  private MultiTableBatchWriter mtbw = null;
-  private Connector connector = null;
-  private Instance instance = null;
-
-  State(Properties props) {
-    this.props = props;
-  }
-
-  public void setMaxVisits(int num) {
-    maxVisits = num;
-  }
-
-  public void visitedNode() throws Exception {
-    numVisits++;
-    if (numVisits > maxVisits) {
-      log.debug("Visited max number (" + maxVisits + ") of nodes");
-      throw new Exception("Visited max number (" + maxVisits + ") of nodes");
-    }
-  }
 
-  public String getPid() {
-    return ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
+  /**
+   * Creates new empty state.
+   */
+  State() {
   }
 
+  /**
+   * Sets a state object.
+   *
+   * @param key key for object
+   * @param value object
+   */
   public void set(String key, Object value) {
     stateMap.put(key, value);
   }
 
+  /**
+   * Removes a state object.
+   *
+   * @param key key for object
+   */
   public void remove(String key) {
     stateMap.remove(key);
   }
 
+  /**
+   * Gets a state object.
+   *
+   * @param key key for object
+   * @return value object
+   * @throws RuntimeException if state object is not present
+   */
   public Object get(String key) {
     if (stateMap.containsKey(key) == false) {
       throw new RuntimeException("State does not contain " + key);
@@ -82,114 +65,56 @@ public class State {
     return stateMap.get(key);
   }
 
-  public HashMap<String,Object> getMap() {
-    return stateMap;
+  /**
+   * Gets a state object, returning null if it is absent.
+   *
+   * @param key key for object
+   * @return value object, or null if not present
+   */
+  public Object getOkIfAbsent(String key) {
+    return stateMap.get(key);
   }
 
   /**
-   * 
-   * @return a copy of Properties, so accidental changes don't affect the framework
+   * Gets the map of state objects. The backing map for state is returned, so
+   * changes to it affect the state.
+   *
+   * @return state map
    */
-  public Properties getProperties() {
-    return new Properties(props);
+  HashMap<String,Object> getMap() {
+    return stateMap;
   }
 
+  /**
+   * Gets a state object as a string.
+   *
+   * @param key key for object
+   * @return value as string
+   * @throws ClassCastException if the value object is not a string
+   */
   public String getString(String key) {
     return (String) stateMap.get(key);
   }
 
+  /**
+   * Gets a state object as an integer.
+   *
+   * @param key key for object
+   * @return value as integer
+   * @throws ClassCastException if the value object is not an integer
+   */
   public Integer getInteger(String key) {
     return (Integer) stateMap.get(key);
   }
 
+  /**
+   * Gets a state object as a long.
+   *
+   * @param key key for object
+   * @return value as long
+   * @throws ClassCastException if the value object is not a long
+   */
   public Long getLong(String key) {
     return (Long) stateMap.get(key);
   }
-
-  public String getProperty(String key) {
-    return props.getProperty(key);
-  }
-
-  public Connector getConnector() throws AccumuloException, AccumuloSecurityException {
-    if (connector == null) {
-      connector = getInstance().getConnector(getUserName(), getToken());
-    }
-    return connector;
-  }
-
-  public Credentials getCredentials() {
-    return new Credentials(getUserName(), getToken());
-  }
-
-  public String getUserName() {
-    return props.getProperty("USERNAME");
-  }
-
-  public AuthenticationToken getToken() {
-    return new PasswordToken(props.getProperty("PASSWORD"));
-  }
-
-  public Instance getInstance() {
-    if (instance == null) {
-      String instance = props.getProperty("INSTANCE");
-      String zookeepers = props.getProperty("ZOOKEEPERS");
-      this.instance = new ZooKeeperInstance(new ClientConfiguration().withInstance(instance).withZkHosts(zookeepers));
-    }
-    return instance;
-  }
-
-  public MultiTableBatchWriter getMultiTableBatchWriter() {
-    if (mtbw == null) {
-      long maxMem = Long.parseLong(props.getProperty("MAX_MEM"));
-      long maxLatency = Long.parseLong(props.getProperty("MAX_LATENCY"));
-      int numThreads = Integer.parseInt(props.getProperty("NUM_THREADS"));
-      mtbw = connector.createMultiTableBatchWriter(new BatchWriterConfig().setMaxMemory(maxMem).setMaxLatency(maxLatency, TimeUnit.MILLISECONDS)
-          .setMaxWriteThreads(numThreads));
-    }
-    return mtbw;
-  }
-
-  public boolean isMultiTableBatchWriterInitialized() {
-    return mtbw != null;
-  }
-
-  public void resetMultiTableBatchWriter() {
-    if (!mtbw.isClosed()) {
-      log.warn("Setting non-closed MultiTableBatchWriter to null (leaking resources)");
-    }
-
-    mtbw = null;
-  }
-
-  public String getMapReduceJars() {
-
-    String acuHome = System.getenv("ACCUMULO_HOME");
-    String zkHome = System.getenv("ZOOKEEPER_HOME");
-
-    if (acuHome == null || zkHome == null) {
-      throw new RuntimeException("ACCUMULO or ZOOKEEPER home not set!");
-    }
-
-    String retval = null;
-
-    File zkLib = new File(zkHome);
-    String[] files = zkLib.list();
-    for (int i = 0; i < files.length; i++) {
-      String f = files[i];
-      if (f.matches("^zookeeper-.+jar$")) {
-        if (retval == null) {
-          retval = String.format("%s/%s", zkLib.getAbsolutePath(), f);
-        } else {
-          retval += String.format(",%s/%s", zkLib.getAbsolutePath(), f);
-        }
-      }
-    }
-
-    File libdir = new File(acuHome + "/lib");
-    for (String jar : "accumulo-core accumulo-server-base accumulo-fate accumulo-trace libthrift".split(" ")) {
-      retval += String.format(",%s/%s.jar", libdir.getAbsolutePath(), jar);
-    }
-
-    return retval;
-  }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkMinusOne.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkMinusOne.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkMinusOne.java
index 4ebf23f..511cb1d 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkMinusOne.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkMinusOne.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.test.randomwalk.bulk;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 
 public class BulkMinusOne extends BulkTest {
@@ -25,9 +26,9 @@ public class BulkMinusOne extends BulkTest {
   private static final Value negOne = new Value("-1".getBytes(Constants.UTF8));
   
   @Override
-  protected void runLater(State state) throws Exception {
+  protected void runLater(State state, Environment env) throws Exception {
     log.info("Decrementing");
-    BulkPlusOne.bulkLoadLots(log, state, negOne);
+    BulkPlusOne.bulkLoadLots(log, state, env, negOne);
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
index cdfbb36..d605e8e 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
@@ -31,6 +31,7 @@ import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.file.FileOperations;
 import org.apache.accumulo.core.file.FileSKVWriter;
 import org.apache.accumulo.core.file.rfile.RFile;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -56,7 +57,7 @@ public class BulkPlusOne extends BulkTest {
   
   private static final Value ONE = new Value("1".getBytes());
 
-  static void bulkLoadLots(Logger log, State state, Value value) throws Exception {
+  static void bulkLoadLots(Logger log, State state, Environment env, Value value) throws Exception {
     final Path dir = new Path("/tmp", "bulk_" + UUID.randomUUID().toString());
     final Path fail = new Path(dir.toString() + "_fail");
     final DefaultConfiguration defaultConfiguration = AccumuloConfiguration.getDefaultConfiguration();
@@ -95,7 +96,7 @@ public class BulkPlusOne extends BulkTest {
       }
       f.close();
     }
-    state.getConnector().tableOperations().importDirectory(Setup.getTableName(), dir.toString(), fail.toString(), true);
+    env.getConnector().tableOperations().importDirectory(Setup.getTableName(), dir.toString(), fail.toString(), true);
     fs.delete(dir, true);
     FileStatus[] failures = fs.listStatus(fail);
     if (failures != null && failures.length > 0) {
@@ -107,9 +108,9 @@ public class BulkPlusOne extends BulkTest {
   }
   
   @Override
-  protected void runLater(State state) throws Exception {
+  protected void runLater(State state, Environment env) throws Exception {
     log.info("Incrementing");
-    bulkLoadLots(log, state, ONE);
+    bulkLoadLots(log, state, env, ONE);
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkTest.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkTest.java
index 4afefd9..6c0c68e 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkTest.java
@@ -18,18 +18,19 @@ package org.apache.accumulo.test.randomwalk.bulk;
 
 import java.util.Properties;
 
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public abstract class BulkTest extends Test {
   
   @Override
-  public void visit(final State state, Properties props) throws Exception {
+  public void visit(final State state, final Environment env, Properties props) throws Exception {
     Setup.run(state, new Runnable() {
       @Override
       public void run() {
         try {
-          runLater(state);
+          runLater(state, env);
         } catch (Throwable ex) {
           log.error(ex, ex);
         }
@@ -38,6 +39,6 @@ public abstract class BulkTest extends Test {
     });
   }
   
-  abstract protected void runLater(State state) throws Exception;
+  abstract protected void runLater(State state, Environment env) throws Exception;
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Compact.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Compact.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Compact.java
index 86dae5c..7561709 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Compact.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Compact.java
@@ -16,17 +16,18 @@
  */
 package org.apache.accumulo.test.randomwalk.bulk;
 
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.hadoop.io.Text;
 
 public class Compact extends BulkTest {
   
   @Override
-  protected void runLater(State state) throws Exception {
+  protected void runLater(State state, Environment env) throws Exception {
     final Text[] points = Merge.getRandomTabletRange(state);
     final String rangeString = Merge.rangeToString(points);
     log.info("Compacting " + rangeString);
-    state.getConnector().tableOperations().compact(Setup.getTableName(), points[0], points[1], false, true);
+    env.getConnector().tableOperations().compact(Setup.getTableName(), points[0], points[1], false, true);
     log.info("Compaction " + rangeString + " finished");
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/ConsistencyCheck.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/ConsistencyCheck.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/ConsistencyCheck.java
index e60f8cf..d1ff8cb 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/ConsistencyCheck.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/ConsistencyCheck.java
@@ -25,19 +25,20 @@ import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.hadoop.io.Text;
 
 public class ConsistencyCheck extends BulkTest {
   
   @Override
-  protected void runLater(State state) throws Exception {
+  protected void runLater(State state, Environment env) throws Exception {
     Random rand = (Random) state.get("rand");
     Text row = Merge.getRandomRow(rand);
     log.info("Checking " + row);
-    String user = state.getConnector().whoami();
-    Authorizations auths = state.getConnector().securityOperations().getUserAuthorizations(user);
-    Scanner scanner = state.getConnector().createScanner(Setup.getTableName(), auths);
+    String user = env.getConnector().whoami();
+    Authorizations auths = env.getConnector().securityOperations().getUserAuthorizations(user);
+    Scanner scanner = env.getConnector().createScanner(Setup.getTableName(), auths);
     scanner = new IsolatedScanner(scanner);
     scanner.setRange(new Range(row));
     scanner.fetchColumnFamily(BulkPlusOne.CHECK_COLUMN_FAMILY);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Merge.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Merge.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Merge.java
index 2dd0345..04af6c5 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Merge.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Merge.java
@@ -19,16 +19,17 @@ package org.apache.accumulo.test.randomwalk.bulk;
 import java.util.Arrays;
 import java.util.Random;
 
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.hadoop.io.Text;
 
 public class Merge extends BulkTest {
   
   @Override
-  protected void runLater(State state) throws Exception {
+  protected void runLater(State state, Environment env) throws Exception {
     Text[] points = getRandomTabletRange(state);
     log.info("merging " + rangeToString(points));
-    state.getConnector().tableOperations().merge(Setup.getTableName(), points[0], points[1]);
+    env.getConnector().tableOperations().merge(Setup.getTableName(), points[0], points[1]);
     log.info("merging " + rangeToString(points) + " complete");
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
index dad2bcc..a2af0bc 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
@@ -28,6 +28,7 @@ import org.apache.accumulo.core.iterators.LongCombiner;
 import org.apache.accumulo.core.iterators.user.SummingCombiner;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.core.util.SimpleThreadPool;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 import org.apache.hadoop.fs.FileSystem;
@@ -38,14 +39,14 @@ public class Setup extends Test {
   static String tableName = null;
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     Random rand = new Random();
     String hostname = InetAddress.getLocalHost().getHostName().replaceAll("[-.]", "_");
-    String pid = state.getPid();
+    String pid = env.getPid();
     tableName = String.format("bulk_%s_%s_%d", hostname, pid, System.currentTimeMillis());
     log.info("Starting bulk test on " + tableName);
     
-    TableOperations tableOps = state.getConnector().tableOperations();
+    TableOperations tableOps = env.getConnector().tableOperations();
     try {
       if (!tableOps.exists(getTableName())) {
         tableOps.create(getTableName());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Split.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Split.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Split.java
index 157e2ab..21b453d 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Split.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Split.java
@@ -20,20 +20,21 @@ import java.util.Random;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.hadoop.io.Text;
 
 public class Split extends BulkTest {
   
   @Override
-  protected void runLater(State state) throws Exception {
+  protected void runLater(State state, Environment env) throws Exception {
     SortedSet<Text> splits = new TreeSet<Text>();
     Random rand = (Random) state.get("rand");
     int count = rand.nextInt(20);
     for (int i = 0; i < count; i++)
       splits.add(new Text(String.format(BulkPlusOne.FMT, (rand.nextLong() & 0x7fffffffffffffffl) % BulkPlusOne.LOTS)));
     log.info("splitting " + splits);
-    state.getConnector().tableOperations().addSplits(Setup.getTableName(), splits);
+    env.getConnector().tableOperations().addSplits(Setup.getTableName(), splits);
     log.info("split for " + splits + " finished");
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
index b2299aa..93bc596 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Verify.java
@@ -30,6 +30,7 @@ import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 import org.apache.hadoop.io.Text;
@@ -39,7 +40,7 @@ public class Verify extends Test {
   static byte[] zero = new byte[] {'0'};
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     ThreadPoolExecutor threadPool = Setup.getThreadPool(state);
     threadPool.shutdown();
     int lastSize = 0;
@@ -56,9 +57,9 @@ public class Verify extends Test {
       return;
     }
     
-    String user = state.getConnector().whoami();
-    Authorizations auths = state.getConnector().securityOperations().getUserAuthorizations(user);
-    Scanner scanner = state.getConnector().createScanner(Setup.getTableName(), auths);
+    String user = env.getConnector().whoami();
+    Authorizations auths = env.getConnector().securityOperations().getUserAuthorizations(user);
+    Scanner scanner = env.getConnector().createScanner(Setup.getTableName(), auths);
     scanner.fetchColumnFamily(BulkPlusOne.CHECK_COLUMN_FAMILY);
     for (Entry<Key,Value> entry : scanner) {
       byte[] value = entry.getValue().get();
@@ -98,7 +99,7 @@ public class Verify extends Test {
     }
 
     log.info("Test successful on table " + Setup.getTableName());
-    state.getConnector().tableOperations().delete(Setup.getTableName());
+    env.getConnector().tableOperations().delete(Setup.getTableName());
   }
     
   public static void main(String args[]) throws Exception {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
index e03b7f6..8fc4fb4 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
@@ -26,6 +26,7 @@ import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.TableOfflineException;
 import org.apache.accumulo.core.metadata.MetadataTable;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 import org.apache.hadoop.io.Text;
@@ -33,8 +34,8 @@ import org.apache.hadoop.io.Text;
 public class AddSplits extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Apocalypse.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Apocalypse.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Apocalypse.java
index 252d52a..512cb1d 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Apocalypse.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Apocalypse.java
@@ -18,13 +18,14 @@ package org.apache.accumulo.test.randomwalk.concurrent;
 
 import java.util.Properties;
 
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class Apocalypse extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     Process exec = Runtime.getRuntime().exec(new String[] {System.getenv("ACCUMULO_HOME") + "/test/system/randomwalk/bin/apocalypse.sh"});
     if (exec.waitFor() != 0)
       throw new RuntimeException("apocalypse.sh returned a non-zero response: " + exec.exitValue());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
index 3fa7d47..6afc7c8 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
@@ -33,14 +33,15 @@ import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class BatchScan extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
index f002274..59e0500 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
@@ -30,14 +30,15 @@ import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.TableOfflineException;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class BatchWrite extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BulkImport.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BulkImport.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BulkImport.java
index d4d6838..5e00642 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BulkImport.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BulkImport.java
@@ -35,6 +35,7 @@ import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.file.blockfile.impl.CachableBlockFile;
 import org.apache.accumulo.core.file.rfile.RFile;
 import org.apache.accumulo.core.util.CachedConfiguration;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 import org.apache.hadoop.conf.Configuration;
@@ -90,8 +91,8 @@ public class BulkImport extends Test {
   }
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
index b882a3a..47b6ef1 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
@@ -25,14 +25,15 @@ import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class ChangeAuthorizations extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangePermissions.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangePermissions.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangePermissions.java
index 73e6175..5df1e21 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangePermissions.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangePermissions.java
@@ -30,14 +30,15 @@ import org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException
 import org.apache.accumulo.core.security.SystemPermission;
 import org.apache.accumulo.core.security.NamespacePermission;
 import org.apache.accumulo.core.security.TablePermission;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class ChangePermissions extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
index 4cb0260..c90286d 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
@@ -27,6 +27,7 @@ import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.metadata.MetadataTable;
 import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
 import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
@@ -42,10 +43,10 @@ public class CheckBalance extends Test {
    * @see org.apache.accumulo.test.randomwalk.Node#visit(org.apache.accumulo.test.randomwalk.State, java.util.Properties)
    */
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     log.debug("checking balance");
     Map<String,Long> counts = new HashMap<String,Long>();
-    Scanner scanner = state.getConnector().createScanner(MetadataTable.NAME, Authorizations.EMPTY);
+    Scanner scanner = env.getConnector().createScanner(MetadataTable.NAME, Authorizations.EMPTY);
     scanner.fetchColumnFamily(TabletsSection.CurrentLocationColumnFamily.NAME);
     for (Entry<Key,Value> entry : scanner) {
       String location = entry.getKey().getColumnQualifier().toString();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckPermission.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckPermission.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckPermission.java
index 50948b3..d759fef 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckPermission.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckPermission.java
@@ -25,14 +25,15 @@ import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.security.NamespacePermission;
 import org.apache.accumulo.core.security.SystemPermission;
 import org.apache.accumulo.core.security.TablePermission;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class CheckPermission extends Test {
 
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
 
     Random rand = (Random) state.get("rand");
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CloneTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CloneTable.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CloneTable.java
index 7802385..90ad14a 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CloneTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CloneTable.java
@@ -27,14 +27,15 @@ 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.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class CloneTable extends Test {
 
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
 
     Random rand = (Random) state.get("rand");
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Compact.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Compact.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Compact.java
index d83055a..30476a4 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Compact.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Compact.java
@@ -23,6 +23,7 @@ import java.util.Random;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.TableOfflineException;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 import org.apache.hadoop.io.Text;
@@ -30,8 +31,8 @@ import org.apache.hadoop.io.Text;
 public class Compact extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
index df7ddd7..9c51e81 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
@@ -21,6 +21,7 @@ import java.util.List;
 import java.util.Random;
 
 import org.apache.accumulo.test.randomwalk.Fixture;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.hadoop.io.Text;
 
@@ -33,10 +34,10 @@ import org.apache.hadoop.io.Text;
 public class ConcurrentFixture extends Fixture {
   
   @Override
-  public void setUp(State state) throws Exception {}
+  public void setUp(State state, Environment env) throws Exception {}
   
   @Override
-  public void tearDown(State state) throws Exception {
+  public void tearDown(State state, Environment env) throws Exception {
     state.remove(CheckBalance.LAST_UNBALANCED_TIME);
     state.remove(CheckBalance.UNBALANCED_COUNT);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
index 402f139..4af85a7 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
@@ -23,6 +23,7 @@ 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.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 import org.apache.commons.math.random.RandomData;
@@ -105,25 +106,25 @@ public class Config extends Test {
   /* @formatter:on */
 
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     // reset any previous setting
-    Object lastSetting = state.getMap().get(LAST_SETTING);
+    Object lastSetting = state.getOkIfAbsent(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());
+      env.getConnector().instanceOperations().setProperty(property.getKey(), property.getDefaultValue());
     }
-    lastSetting = state.getMap().get(LAST_TABLE_SETTING);
+    lastSetting = state.getOkIfAbsent(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)) {
+      if (env.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());
+          env.getConnector().tableOperations().setProperty(table, property.getKey(), property.getDefaultValue());
         } catch (AccumuloException ex) {
           if (ex.getCause() instanceof ThriftTableOperationException) {
             ThriftTableOperationException ttoe = (ThriftTableOperationException) ex.getCause();
@@ -134,16 +135,16 @@ public class Config extends Test {
         }
       }
     }
-    lastSetting = state.getMap().get(LAST_NAMESPACE_SETTING);
+    lastSetting = state.getOkIfAbsent(LAST_NAMESPACE_SETTING);
     if (lastSetting != null) {
       String parts[] = lastSetting.toString().split(",");
       String namespace = parts[0];
       int choice = Integer.parseInt(parts[1]);
       Property property = tableSettings[choice].property;
-      if (state.getConnector().namespaceOperations().exists(namespace)) {
+      if (env.getConnector().namespaceOperations().exists(namespace)) {
         log.debug("Setting " + property.getKey() + " on " + namespace + " back to " + property.getDefaultValue());
         try {
-          state.getConnector().namespaceOperations().setProperty(namespace, property.getKey(), property.getDefaultValue());
+          env.getConnector().namespaceOperations().setProperty(namespace, property.getKey(), property.getDefaultValue());
         } catch (AccumuloException ex) {
           if (ex.getCause() instanceof ThriftTableOperationException) {
             ThriftTableOperationException ttoe = (ThriftTableOperationException) ex.getCause();
@@ -154,37 +155,37 @@ public class Config extends Test {
         }
       }
     }
-    state.getMap().remove(LAST_SETTING);
-    state.getMap().remove(LAST_TABLE_SETTING);
-    state.getMap().remove(LAST_NAMESPACE_SETTING);
+    state.remove(LAST_SETTING);
+    state.remove(LAST_TABLE_SETTING);
+    state.remove(LAST_NAMESPACE_SETTING);
     RandomData random = new RandomDataImpl();
     int dice = random.nextInt(0, 2);
     if (dice == 0) {
-      changeTableSetting(random, state, props);
+      changeTableSetting(random, state, env, props);
     } else if (dice == 1) {
-      changeNamespaceSetting(random, state, props);
+      changeNamespaceSetting(random, state, env, props);
     } else {
-      changeSetting(random, state, props);
+      changeSetting(random, state, env, props);
     }
   }
 
-  private void changeTableSetting(RandomData random, State state, Properties props) throws Exception {
+  private void changeTableSetting(RandomData random, State state, Environment env, Properties props) throws Exception {
     // pick a random property
     int choice = random.nextInt(0, tableSettings.length - 1);
     Setting setting = tableSettings[choice];
 
     // pick a random table
-    SortedSet<String> tables = state.getConnector().tableOperations().list().tailSet("ctt").headSet("ctu");
+    SortedSet<String> tables = env.getConnector().tableOperations().list().tailSet("ctt").headSet("ctu");
     if (tables.isEmpty())
       return;
     String table = random.nextSample(tables, 1)[0].toString();
 
     // generate a random value
     long newValue = random.nextLong(setting.min, setting.max);
-    state.getMap().put(LAST_TABLE_SETTING, table + "," + choice);
+    state.set(LAST_TABLE_SETTING, table + "," + choice);
     log.debug("Setting " + setting.property.getKey() + " on table " + table + " to " + newValue);
     try {
-      state.getConnector().tableOperations().setProperty(table, setting.property.getKey(), "" + newValue);
+      env.getConnector().tableOperations().setProperty(table, setting.property.getKey(), "" + newValue);
     } catch (AccumuloException ex) {
       if (ex.getCause() instanceof ThriftTableOperationException) {
         ThriftTableOperationException ttoe = (ThriftTableOperationException) ex.getCause();
@@ -195,23 +196,23 @@ public class Config extends Test {
     }
   }
 
-  private void changeNamespaceSetting(RandomData random, State state, Properties props) throws Exception {
+  private void changeNamespaceSetting(RandomData random, State state, Environment env, Properties props) throws Exception {
     // pick a random property
     int choice = random.nextInt(0, tableSettings.length - 1);
     Setting setting = tableSettings[choice];
 
     // pick a random table
-    SortedSet<String> namespaces = state.getConnector().namespaceOperations().list();
+    SortedSet<String> namespaces = env.getConnector().namespaceOperations().list();
     if (namespaces.isEmpty())
       return;
     String namespace = random.nextSample(namespaces, 1)[0].toString();
 
     // generate a random value
     long newValue = random.nextLong(setting.min, setting.max);
-    state.getMap().put(LAST_NAMESPACE_SETTING, namespace + "," + choice);
+    state.set(LAST_NAMESPACE_SETTING, namespace + "," + choice);
     log.debug("Setting " + setting.property.getKey() + " on namespace " + namespace + " to " + newValue);
     try {
-      state.getConnector().namespaceOperations().setProperty(namespace, setting.property.getKey(), "" + newValue);
+      env.getConnector().namespaceOperations().setProperty(namespace, setting.property.getKey(), "" + newValue);
     } catch (AccumuloException ex) {
       if (ex.getCause() instanceof ThriftTableOperationException) {
         ThriftTableOperationException ttoe = (ThriftTableOperationException) ex.getCause();
@@ -222,15 +223,15 @@ public class Config extends Test {
     }
   }
 
-  private void changeSetting(RandomData random, State state, Properties props) throws Exception {
+  private void changeSetting(RandomData random, State state, Environment env, Properties props) throws Exception {
     // pick a random property
     int choice = random.nextInt(0, settings.length - 1);
     Setting setting = settings[choice];
     // generate a random value
     long newValue = random.nextLong(setting.min, setting.max);
-    state.getMap().put(LAST_SETTING, "" + choice);
+    state.set(LAST_SETTING, "" + choice);
     log.debug("Setting " + setting.property.getKey() + " to " + newValue);
-    state.getConnector().instanceOperations().setProperty(setting.property.getKey(), "" + newValue);
+    env.getConnector().instanceOperations().setProperty(setting.property.getKey(), "" + newValue);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateNamespace.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateNamespace.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateNamespace.java
index 43e6c06..a30c958 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateNamespace.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateNamespace.java
@@ -22,14 +22,15 @@ import java.util.Random;
 
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.NamespaceExistsException;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class CreateNamespace extends Test {
 
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
 
     Random rand = (Random) state.get("rand");
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateTable.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateTable.java
index 21ae031..b9e1ece 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateTable.java
@@ -25,14 +25,15 @@ import org.apache.accumulo.core.client.AccumuloSecurityException;
 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.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class CreateTable extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateUser.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateUser.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateUser.java
index 24f25f3..8f265ad 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateUser.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateUser.java
@@ -23,13 +23,14 @@ import java.util.Random;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class CreateUser extends Test {
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteNamespace.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteNamespace.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteNamespace.java
index 333af3d..07d7350 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteNamespace.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteNamespace.java
@@ -23,14 +23,15 @@ import java.util.Random;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.NamespaceNotEmptyException;
 import org.apache.accumulo.core.client.NamespaceNotFoundException;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class DeleteNamespace extends Test {
 
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
 
     Random rand = (Random) state.get("rand");
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteRange.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteRange.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteRange.java
index 9b44782..ced8011 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteRange.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteRange.java
@@ -25,6 +25,7 @@ import java.util.Random;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.TableOfflineException;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 import org.apache.hadoop.io.Text;
@@ -32,8 +33,8 @@ import org.apache.hadoop.io.Text;
 public class DeleteRange extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteTable.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteTable.java
index 8adae64..6fb9f7f 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteTable.java
@@ -22,14 +22,15 @@ import java.util.Random;
 
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class DeleteTable extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DropUser.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DropUser.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DropUser.java
index 672c4b8..13d3c05 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DropUser.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DropUser.java
@@ -22,13 +22,14 @@ import java.util.Random;
 
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class DropUser extends Test {
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/IsolatedScan.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/IsolatedScan.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/IsolatedScan.java
index 905aa8e..78f73b4 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/IsolatedScan.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/IsolatedScan.java
@@ -31,14 +31,15 @@ import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.util.PeekingIterator;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class IsolatedScan extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ListSplits.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ListSplits.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ListSplits.java
index 0f3d87f..1f82fc0 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ListSplits.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ListSplits.java
@@ -24,6 +24,7 @@ import java.util.Random;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 import org.apache.hadoop.io.Text;
@@ -31,8 +32,8 @@ import org.apache.hadoop.io.Text;
 public class ListSplits extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java
index a16f6a6..84a4665 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java
@@ -25,6 +25,7 @@ import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.TableOfflineException;
 import org.apache.accumulo.core.metadata.MetadataTable;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 import org.apache.hadoop.io.Text;
@@ -32,8 +33,8 @@ import org.apache.hadoop.io.Text;
 public class Merge extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/OfflineTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/OfflineTable.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/OfflineTable.java
index c4d9bab..1d725bc 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/OfflineTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/OfflineTable.java
@@ -23,14 +23,15 @@ import java.util.Random;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.util.UtilWaitThread;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class OfflineTable extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
     
     Random rand = (Random) state.get("rand");
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/RenameNamespace.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/RenameNamespace.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/RenameNamespace.java
index 5aa21ed..f46fa12 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/RenameNamespace.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/RenameNamespace.java
@@ -23,14 +23,15 @@ import java.util.Random;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.NamespaceExistsException;
 import org.apache.accumulo.core.client.NamespaceNotFoundException;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class RenameNamespace extends Test {
 
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getConnector();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getConnector();
 
     Random rand = (Random) state.get("rand");
 


Mime
View raw message