accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhava...@apache.org
Subject [1/3] ACCUMULO-841 Refactor randomwalk State class
Date Mon, 24 Feb 2014 16:01:32 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 2563b14b5 -> a74f392ea


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SetAuths.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SetAuths.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SetAuths.java
index 54bc34a..e20367d 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SetAuths.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SetAuths.java
@@ -25,13 +25,14 @@ import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.Credentials;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class SetAuths extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     String authsString = props.getProperty("auths", "_random");
     
     String targetUser = props.getProperty("system");
@@ -39,22 +40,22 @@ public class SetAuths extends Test {
     String authPrincipal;
     AuthenticationToken authToken;
     if ("table".equals(targetUser)) {
-      target = WalkingSecurity.get(state).getTabUserName();
-      authPrincipal = WalkingSecurity.get(state).getSysUserName();
-      authToken = WalkingSecurity.get(state).getSysToken();
+      target = WalkingSecurity.get(state,env).getTabUserName();
+      authPrincipal = WalkingSecurity.get(state,env).getSysUserName();
+      authToken = WalkingSecurity.get(state,env).getSysToken();
     } else {
-      target = WalkingSecurity.get(state).getSysUserName();
-      authPrincipal = state.getUserName();
-      authToken = state.getToken();
+      target = WalkingSecurity.get(state,env).getSysUserName();
+      authPrincipal = env.getUserName();
+      authToken = env.getToken();
     }
-    Connector conn = state.getInstance().getConnector(authPrincipal, authToken);
+    Connector conn = env.getInstance().getConnector(authPrincipal, authToken);
     
-    boolean exists = WalkingSecurity.get(state).userExists(target);
-    boolean hasPermission = WalkingSecurity.get(state).canChangeAuthorizations(new Credentials(authPrincipal, authToken).toThrift(state.getInstance()), target);
+    boolean exists = WalkingSecurity.get(state,env).userExists(target);
+    boolean hasPermission = WalkingSecurity.get(state,env).canChangeAuthorizations(new Credentials(authPrincipal, authToken).toThrift(env.getInstance()), target);
     
     Authorizations auths;
     if (authsString.equals("_random")) {
-      String[] possibleAuths = WalkingSecurity.get(state).getAuthsArray();
+      String[] possibleAuths = WalkingSecurity.get(state,env).getAuthsArray();
       
       Random r = new Random();
       int i = r.nextInt(possibleAuths.length);
@@ -90,7 +91,7 @@ public class SetAuths extends Test {
           throw new AccumuloException("Got unexpected exception", ae);
       }
     }
-    WalkingSecurity.get(state).changeAuthorizations(target, auths);
+    WalkingSecurity.get(state,env).changeAuthorizations(target, auths);
     if (!hasPermission)
       throw new AccumuloException("Didn't get Security Exception when we should have");
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
index b084dcc..1d7b8a1 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
@@ -44,6 +44,7 @@ import org.apache.accumulo.core.file.rfile.RFile;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.ColumnVisibility;
 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;
 import org.apache.hadoop.fs.FileSystem;
@@ -53,8 +54,8 @@ import org.apache.hadoop.io.Text;
 public class TableOp extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    Connector conn = state.getInstance().getConnector(WalkingSecurity.get(state).getTabUserName(), WalkingSecurity.get(state).getTabToken());
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    Connector conn = env.getInstance().getConnector(WalkingSecurity.get(state,env).getTabUserName(), WalkingSecurity.get(state,env).getTabToken());
     
     String action = props.getProperty("action", "_random");
     TablePermission tp;
@@ -65,16 +66,16 @@ public class TableOp extends Test {
       tp = TablePermission.valueOf(action);
     }
     
-    boolean tableExists = WalkingSecurity.get(state).getTableExists();
-    String tableName = WalkingSecurity.get(state).getTableName();
-    String namespaceName = WalkingSecurity.get(state).getNamespaceName();
+    boolean tableExists = WalkingSecurity.get(state,env).getTableExists();
+    String tableName = WalkingSecurity.get(state,env).getTableName();
+    String namespaceName = WalkingSecurity.get(state,env).getNamespaceName();
     
     switch (tp) {
       case READ: {
-        boolean canRead = WalkingSecurity.get(state).canScan(WalkingSecurity.get(state).getTabCredentials(), tableName, namespaceName);
-        Authorizations auths = WalkingSecurity.get(state).getUserAuthorizations(WalkingSecurity.get(state).getTabCredentials());
-        boolean ambiguousZone = WalkingSecurity.get(state).inAmbiguousZone(conn.whoami(), tp);
-        boolean ambiguousAuths = WalkingSecurity.get(state).ambiguousAuthorizations(conn.whoami());
+        boolean canRead = WalkingSecurity.get(state,env).canScan(WalkingSecurity.get(state,env).getTabCredentials(), tableName, namespaceName);
+        Authorizations auths = WalkingSecurity.get(state,env).getUserAuthorizations(WalkingSecurity.get(state,env).getTabCredentials());
+        boolean ambiguousZone = WalkingSecurity.get(state,env).inAmbiguousZone(conn.whoami(), tp);
+        boolean ambiguousAuths = WalkingSecurity.get(state,env).ambiguousAuthorizations(conn.whoami());
         
         Scanner scan = null;
         try {
@@ -90,7 +91,7 @@ public class TableOp extends Test {
           }
           if (!canRead && !ambiguousZone)
             throw new AccumuloException("Was able to read when I shouldn't have had the perm with connection user " + conn.whoami() + " table " + tableName);
-          for (Entry<String,Integer> entry : WalkingSecurity.get(state).getAuthsMap().entrySet()) {
+          for (Entry<String,Integer> entry : WalkingSecurity.get(state,env).getAuthsMap().entrySet()) {
             if (auths.contains(entry.getKey().getBytes(Constants.UTF8)))
               seen = seen - entry.getValue();
           }
@@ -142,12 +143,12 @@ public class TableOp extends Test {
         break;
       }
       case WRITE:
-        boolean canWrite = WalkingSecurity.get(state).canWrite(WalkingSecurity.get(state).getTabCredentials(), tableName, namespaceName);
-        boolean ambiguousZone = WalkingSecurity.get(state).inAmbiguousZone(conn.whoami(), tp);
+        boolean canWrite = WalkingSecurity.get(state,env).canWrite(WalkingSecurity.get(state,env).getTabCredentials(), tableName, namespaceName);
+        boolean ambiguousZone = WalkingSecurity.get(state,env).inAmbiguousZone(conn.whoami(), tp);
         
-        String key = WalkingSecurity.get(state).getLastKey() + "1";
+        String key = WalkingSecurity.get(state,env).getLastKey() + "1";
         Mutation m = new Mutation(new Text(key));
-        for (String s : WalkingSecurity.get(state).getAuthsArray()) {
+        for (String s : WalkingSecurity.get(state,env).getAuthsArray()) {
           m.put(new Text(), new Text(), new ColumnVisibility(s), new Value("value".getBytes(Constants.UTF8)));
         }
         BatchWriter writer = null;
@@ -182,8 +183,8 @@ public class TableOp extends Test {
             }
           }
           if (works)
-            for (String s : WalkingSecurity.get(state).getAuthsArray())
-              WalkingSecurity.get(state).increaseAuthMap(s, 1);
+            for (String s : WalkingSecurity.get(state,env).getAuthsArray())
+              WalkingSecurity.get(state,env).increaseAuthMap(s, 1);
         } finally {
           if (writer != null) {
             writer.close();
@@ -192,15 +193,15 @@ public class TableOp extends Test {
         }
         break;
       case BULK_IMPORT:
-        key = WalkingSecurity.get(state).getLastKey() + "1";
+        key = WalkingSecurity.get(state,env).getLastKey() + "1";
         SortedSet<Key> keys = new TreeSet<Key>();
-        for (String s : WalkingSecurity.get(state).getAuthsArray()) {
+        for (String s : WalkingSecurity.get(state,env).getAuthsArray()) {
           Key k = new Key(key, "", "", s);
           keys.add(k);
         }
         Path dir = new Path("/tmp", "bulk_" + UUID.randomUUID().toString());
         Path fail = new Path(dir.toString() + "_fail");
-        FileSystem fs = WalkingSecurity.get(state).getFs();
+        FileSystem fs = WalkingSecurity.get(state,env).getFs();
         FileSKVWriter f = FileOperations.getInstance().openWriter(dir + "/securityBulk." + RFile.EXTENSION, fs, fs.getConf(),
             AccumuloConfiguration.getDefaultConfiguration());
         f.startDefaultLocalityGroup();
@@ -216,26 +217,26 @@ public class TableOp extends Test {
           return;
         } catch (AccumuloSecurityException ae) {
           if (ae.getSecurityErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
-            if (WalkingSecurity.get(state).canBulkImport(WalkingSecurity.get(state).getTabCredentials(), tableName, namespaceName))
+            if (WalkingSecurity.get(state,env).canBulkImport(WalkingSecurity.get(state,env).getTabCredentials(), tableName, namespaceName))
               throw new AccumuloException("Bulk Import failed when it should have worked: " + tableName);
             return;
           } else if (ae.getSecurityErrorCode().equals(SecurityErrorCode.BAD_CREDENTIALS)) {
-            if (WalkingSecurity.get(state).userPassTransient(conn.whoami()))
+            if (WalkingSecurity.get(state,env).userPassTransient(conn.whoami()))
               return;
           }
           throw new AccumuloException("Unexpected exception!", ae);
         }
-        for (String s : WalkingSecurity.get(state).getAuthsArray())
-          WalkingSecurity.get(state).increaseAuthMap(s, 1);
+        for (String s : WalkingSecurity.get(state,env).getAuthsArray())
+          WalkingSecurity.get(state,env).increaseAuthMap(s, 1);
         fs.delete(dir, true);
         fs.delete(fail, true);
         
-        if (!WalkingSecurity.get(state).canBulkImport(WalkingSecurity.get(state).getTabCredentials(), tableName, namespaceName))
+        if (!WalkingSecurity.get(state,env).canBulkImport(WalkingSecurity.get(state,env).getTabCredentials(), tableName, namespaceName))
           throw new AccumuloException("Bulk Import succeeded when it should have failed: " + dir + " table " + tableName);
         break;
       case ALTER_TABLE:
-        AlterTable.renameTable(conn, state, tableName, tableName + "plus",
-            WalkingSecurity.get(state).canAlterTable(WalkingSecurity.get(state).getTabCredentials(), tableName, namespaceName), tableExists);
+        AlterTable.renameTable(conn, state, env, tableName, tableName + "plus",
+            WalkingSecurity.get(state,env).canAlterTable(WalkingSecurity.get(state,env).getTabCredentials(), tableName, namespaceName), tableExists);
         break;
       
       case GRANT:
@@ -243,12 +244,12 @@ public class TableOp extends Test {
         props.setProperty("perm", "random");
         props.setProperty("source", "table");
         props.setProperty("target", "system");
-        AlterTablePerm.alter(state, props);
+        AlterTablePerm.alter(state, env, props);
         break;
       
       case DROP_TABLE:
         props.setProperty("source", "table");
-        DropTable.dropTable(state, props);
+        DropTable.dropTable(state, env, props);
         break;
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java
index 03718ce..905327a 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java
@@ -26,6 +26,7 @@ import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
 import org.apache.accumulo.core.security.Authorizations;
 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;
 import org.apache.log4j.Logger;
@@ -33,32 +34,32 @@ import org.apache.log4j.Logger;
 public class Validate extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    validate(state, log);
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    validate(state, env, log);
   }
   
-  public static void validate(State state, Logger log) throws Exception {
-    Connector conn = state.getConnector();
+  public static void validate(State state, Environment env, Logger log) throws Exception {
+    Connector conn = env.getConnector();
     
-    boolean tableExists = WalkingSecurity.get(state).getTableExists();
-    boolean cloudTableExists = conn.tableOperations().list().contains(WalkingSecurity.get(state).getTableName());
+    boolean tableExists = WalkingSecurity.get(state,env).getTableExists();
+    boolean cloudTableExists = conn.tableOperations().list().contains(WalkingSecurity.get(state,env).getTableName());
     if (tableExists != cloudTableExists)
       throw new AccumuloException("Table existance out of sync");
     
-    boolean tableUserExists = WalkingSecurity.get(state).userExists(WalkingSecurity.get(state).getTabUserName());
-    boolean cloudTableUserExists = conn.securityOperations().listLocalUsers().contains(WalkingSecurity.get(state).getTabUserName());
+    boolean tableUserExists = WalkingSecurity.get(state,env).userExists(WalkingSecurity.get(state,env).getTabUserName());
+    boolean cloudTableUserExists = conn.securityOperations().listLocalUsers().contains(WalkingSecurity.get(state,env).getTabUserName());
     if (tableUserExists != cloudTableUserExists)
       throw new AccumuloException("Table User existance out of sync");
     
     Properties props = new Properties();
     props.setProperty("target", "system");
-    Authenticate.authenticate(state.getUserName(), state.getToken(), state, props);
+    Authenticate.authenticate(env.getUserName(), env.getToken(), state, env, props);
     props.setProperty("target", "table");
-    Authenticate.authenticate(state.getUserName(), state.getToken(), state, props);
+    Authenticate.authenticate(env.getUserName(), env.getToken(), state, env, props);
     
-    for (String user : new String[] {WalkingSecurity.get(state).getSysUserName(), WalkingSecurity.get(state).getTabUserName()}) {
+    for (String user : new String[] {WalkingSecurity.get(state,env).getSysUserName(), WalkingSecurity.get(state,env).getTabUserName()}) {
       for (SystemPermission sp : SystemPermission.values()) {
-        boolean hasSp = WalkingSecurity.get(state).hasSystemPermission(user, sp);
+        boolean hasSp = WalkingSecurity.get(state,env).hasSystemPermission(user, sp);
         boolean accuHasSp;
         try {
           accuHasSp = conn.securityOperations().hasSystemPermission(user, sp);
@@ -77,10 +78,10 @@ public class Validate extends Test {
       }
       
       for (TablePermission tp : TablePermission.values()) {
-        boolean hasTp = WalkingSecurity.get(state).hasTablePermission(user, WalkingSecurity.get(state).getTableName(), tp);
+        boolean hasTp = WalkingSecurity.get(state,env).hasTablePermission(user, WalkingSecurity.get(state,env).getTableName(), tp);
         boolean accuHasTp;
         try {
-          accuHasTp = conn.securityOperations().hasTablePermission(user, WalkingSecurity.get(state).getTableName(), tp);
+          accuHasTp = conn.securityOperations().hasTablePermission(user, WalkingSecurity.get(state,env).getTableName(), tp);
           log.debug("Just checked to see if user " + user + " has table perm " + tp.name() + " with answer " + accuHasTp);
         } catch (AccumuloSecurityException ae) {
           if (ae.getSecurityErrorCode().equals(SecurityErrorCode.USER_DOESNT_EXIST)) {
@@ -105,8 +106,8 @@ public class Validate extends Test {
     Authorizations accuAuths;
     Authorizations auths;
     try {
-      auths = WalkingSecurity.get(state).getUserAuthorizations(WalkingSecurity.get(state).getTabCredentials());
-      accuAuths = conn.securityOperations().getUserAuthorizations(WalkingSecurity.get(state).getTabUserName());
+      auths = WalkingSecurity.get(state,env).getUserAuthorizations(WalkingSecurity.get(state,env).getTabCredentials());
+      accuAuths = conn.securityOperations().getUserAuthorizations(WalkingSecurity.get(state,env).getTabUserName());
     } catch (ThriftSecurityException ae) {
       if (ae.getCode() == org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode.USER_DOESNT_EXIST) {
         if (tableUserExists)

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
index 76528c6..5b112e2 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
@@ -44,6 +44,7 @@ import org.apache.accumulo.server.security.SecurityOperation;
 import org.apache.accumulo.server.security.handler.Authenticator;
 import org.apache.accumulo.server.security.handler.Authorizor;
 import org.apache.accumulo.server.security.handler.PermissionHandler;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.log4j.Logger;
@@ -53,6 +54,7 @@ import org.apache.log4j.Logger;
  */
 public class WalkingSecurity extends SecurityOperation implements Authorizor, Authenticator, PermissionHandler {
   State state = null;
+  Environment env = null;
   protected final static Logger log = Logger.getLogger(WalkingSecurity.class);
 
   private static final String tableName = "SecurityTableName";
@@ -76,17 +78,18 @@ public class WalkingSecurity extends SecurityOperation implements Authorizor, Au
     super(author, authent, pm, instanceId);
   }
 
-  public WalkingSecurity(State state2) {
-    super(state2.getInstance().getInstanceID());
+  public WalkingSecurity(State state2, Environment env2) {
+    super(env2.getInstance().getInstanceID());
     this.state = state2;
+    this.env = env2;
     authorizor = this;
     authenticator = this;
     permHandle = this;
   }
 
-  public static WalkingSecurity get(State state) {
+  public static WalkingSecurity get(State state, Environment env) {
     if (instance == null || instance.state != state) {
-      instance = new WalkingSecurity(state);
+      instance = new WalkingSecurity(state, env);
       state.set(tableExists, Boolean.toString(false));
       state.set(namespaceExists, Boolean.toString(false));
       state.set(authsMap, new HashMap<String,Integer>());
@@ -350,11 +353,11 @@ public class WalkingSecurity extends SecurityOperation implements Authorizor, Au
   }
 
   public TCredentials getSysCredentials() {
-    return new Credentials(getSysUserName(), getSysToken()).toThrift(this.state.getInstance());
+    return new Credentials(getSysUserName(), getSysToken()).toThrift(this.env.getInstance());
   }
 
   public TCredentials getTabCredentials() {
-    return new Credentials(getTabUserName(), getTabToken()).toThrift(this.state.getInstance());
+    return new Credentials(getTabUserName(), getTabToken()).toThrift(this.env.getInstance());
   }
 
   public AuthenticationToken getSysToken() {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
index 04da64d..6a725c7 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
@@ -30,6 +30,7 @@ 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;
 import org.apache.hadoop.io.Text;
@@ -37,7 +38,7 @@ import org.apache.hadoop.io.Text;
 public class BatchVerify extends Test {
   
   @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();
     
@@ -49,7 +50,7 @@ public class BatchVerify extends Test {
       numVerify = numWrites / 4;
     }
     
-    Connector conn = state.getConnector();
+    Connector conn = env.getConnector();
     BatchScanner scanner = conn.createBatchScanner(state.getString("seqTableName"), new Authorizations(), 2);
     
     try {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
index cd1ccab..7d5102e 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
@@ -18,15 +18,16 @@ package org.apache.accumulo.test.randomwalk.sequential;
 
 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 Commit extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     
-    state.getMultiTableBatchWriter().flush();
+    env.getMultiTableBatchWriter().flush();
     
     log.debug("Committed " + state.getLong("numWrites") + " writes.  Total writes: " + state.getLong("totalWrites"));
     state.set("numWrites", Long.valueOf(0));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerify.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerify.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerify.java
index f60fe44..4337799 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerify.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerify.java
@@ -26,6 +26,7 @@ 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.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.util.ToolRunner;
@@ -33,16 +34,16 @@ import org.apache.hadoop.util.ToolRunner;
 public class MapRedVerify extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     
     String[] args = new String[8];
     args[0] = "-libjars";
-    args[1] = state.getMapReduceJars();
-    args[2] = state.getProperty("USERNAME");
-    args[3] = state.getProperty("PASSWORD");
+    args[1] = getMapReduceJars();
+    args[2] = env.getUserName();
+    args[3] = env.getPassword();
     args[4] = state.getString("seqTableName");
-    args[5] = state.getInstance().getInstanceName();
-    args[6] = state.getProperty("ZOOKEEPERS");
+    args[5] = env.getInstance().getInstanceName();
+    args[6] = env.getConfigProperty("ZOOKEEPERS");
     args[7] = args[4] + "_MR";
     
     if (ToolRunner.run(CachedConfiguration.getInstance(), new MapRedVerifyTool(), args) != 0) {
@@ -50,7 +51,7 @@ public class MapRedVerify extends Test {
       return;
     }
     
-    Scanner outputScanner = state.getConnector().createScanner(args[7], Authorizations.EMPTY);
+    Scanner outputScanner = env.getConnector().createScanner(args[7], Authorizations.EMPTY);
     outputScanner.setRange(new Range());
     
     int count = 0;
@@ -69,7 +70,7 @@ public class MapRedVerify extends Test {
     }
     
     log.debug("Dropping table: " + args[7]);
-    Connector conn = state.getConnector();
+    Connector conn = env.getConnector();
     conn.tableOperations().delete(args[7]);
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
index 927a803..c2320a7 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
@@ -25,6 +25,7 @@ import org.apache.accumulo.core.client.MutationsRejectedException;
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.impl.Tables;
 import org.apache.accumulo.test.randomwalk.Fixture;
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 
 public class SequentialFixture extends Fixture {
@@ -32,14 +33,14 @@ public class SequentialFixture extends Fixture {
   String seqTableName;
   
   @Override
-  public void setUp(State state) throws Exception {
+  public void setUp(State state, Environment env) throws Exception {
     
-    Connector conn = state.getConnector();
-    Instance instance = state.getInstance();
+    Connector conn = env.getConnector();
+    Instance instance = env.getInstance();
     
     String hostname = InetAddress.getLocalHost().getHostName().replaceAll("[-.]", "_");
     
-    seqTableName = String.format("sequential_%s_%s_%d", hostname, state.getPid(), System.currentTimeMillis());
+    seqTableName = String.format("sequential_%s_%s_%d", hostname, env.getPid(), System.currentTimeMillis());
     state.set("seqTableName", seqTableName);
     
     try {
@@ -56,10 +57,10 @@ public class SequentialFixture extends Fixture {
   }
   
   @Override
-  public void tearDown(State state) throws Exception {
+  public void tearDown(State state, Environment env) throws Exception {
     // We have resources we need to clean up
-    if (state.isMultiTableBatchWriterInitialized()) {
-      MultiTableBatchWriter mtbw = state.getMultiTableBatchWriter();
+    if (env.isMultiTableBatchWriterInitialized()) {
+      MultiTableBatchWriter mtbw = env.getMultiTableBatchWriter();
       try {
         mtbw.close();
       } catch (MutationsRejectedException e) {
@@ -67,12 +68,12 @@ public class SequentialFixture extends Fixture {
       }
       
       // Reset the MTBW on the state to null
-      state.resetMultiTableBatchWriter();
+      env.resetMultiTableBatchWriter();
     }
     
     log.debug("Dropping tables: " + seqTableName);
     
-    Connector conn = state.getConnector();
+    Connector conn = env.getConnector();
     
     conn.tableOperations().delete(seqTableName);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
index d14f96e..063caa8 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
@@ -22,6 +22,7 @@ import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchWriter;
 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;
 import org.apache.hadoop.io.Text;
@@ -29,9 +30,9 @@ import org.apache.hadoop.io.Text;
 public class Write extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     
-    BatchWriter bw = state.getMultiTableBatchWriter().getBatchWriter(state.getString("seqTableName"));
+    BatchWriter bw = env.getMultiTableBatchWriter().getBatchWriter(state.getString("seqTableName"));
     
     state.set("numWrites", state.getLong("numWrites") + 1);
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
index 41acce2..b6d064a 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
@@ -35,6 +35,7 @@ import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.core.util.TextUtil;
 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;
 import org.apache.commons.codec.binary.Base64;
@@ -93,7 +94,7 @@ public class BulkInsert extends Test {
   }
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     
     String indexTableName = (String) state.get("indexTableName");
     String dataTableName = (String) state.get("docTableName");
@@ -127,23 +128,23 @@ public class BulkInsert extends Test {
     dataWriter.close();
     indexWriter.close();
     
-    sort(state, fs, dataTableName, rootDir + "/data.seq", rootDir + "/data_bulk", rootDir + "/data_work", maxSplits);
-    sort(state, fs, indexTableName, rootDir + "/index.seq", rootDir + "/index_bulk", rootDir + "/index_work", maxSplits);
+    sort(state, env, fs, dataTableName, rootDir + "/data.seq", rootDir + "/data_bulk", rootDir + "/data_work", maxSplits);
+    sort(state, env, fs, indexTableName, rootDir + "/index.seq", rootDir + "/index_bulk", rootDir + "/index_work", maxSplits);
     
-    bulkImport(fs, state, dataTableName, rootDir, "data");
-    bulkImport(fs, state, indexTableName, rootDir, "index");
+    bulkImport(fs, state, env, dataTableName, rootDir, "data");
+    bulkImport(fs, state, env, indexTableName, rootDir, "index");
     
     fs.delete(new Path(rootDir), true);
   }
   
-  private void bulkImport(FileSystem fs, State state, String tableName, String rootDir, String prefix) throws Exception {
+  private void bulkImport(FileSystem fs, State state, Environment env, String tableName, String rootDir, String prefix) throws Exception {
     while (true) {
       String bulkDir = rootDir + "/" + prefix + "_bulk";
       String failDir = rootDir + "/" + prefix + "_failure";
       Path failPath = new Path(failDir);
       fs.delete(failPath, true);
       fs.mkdirs(failPath);
-      state.getConnector().tableOperations().importDirectory(tableName, bulkDir, failDir, true);
+      env.getConnector().tableOperations().importDirectory(tableName, bulkDir, failDir, true);
       
       FileStatus[] failures = fs.listStatus(failPath);
       if (failures != null && failures.length > 0) {
@@ -161,11 +162,11 @@ public class BulkInsert extends Test {
     }
   }
   
-  private void sort(State state, FileSystem fs, String tableName, String seqFile, String outputDir, String workDir, int maxSplits) throws Exception {
+  private void sort(State state, Environment env, FileSystem fs, String tableName, String seqFile, String outputDir, String workDir, int maxSplits) throws Exception {
     
     PrintStream out = new PrintStream(new BufferedOutputStream(fs.create(new Path(workDir + "/splits.txt"))), false, Constants.UTF8.name());
     
-    Connector conn = state.getConnector();
+    Connector conn = env.getConnector();
     
     Collection<Text> splits = conn.tableOperations().listSplits(tableName, maxSplits);
     for (Text split : splits)
@@ -177,7 +178,7 @@ public class BulkInsert extends Test {
     
     String[] args = new String[2];
     args[0] = "-libjars";
-    args[1] = state.getMapReduceJars();
+    args[1] = getMapReduceJars();
     
     if (ToolRunner.run(CachedConfiguration.getInstance(), sortTool, args) != 0) {
       throw new Exception("Failed to run map/red verify");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CloneIndex.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CloneIndex.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CloneIndex.java
index 5a22e1d..77f34bc 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CloneIndex.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CloneIndex.java
@@ -20,21 +20,22 @@ import java.util.HashMap;
 import java.util.HashSet;
 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 CloneIndex extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     
     String indexTableName = (String) state.get("indexTableName");
     String tmpIndexTableName = indexTableName + "_tmp";
     
     long t1 = System.currentTimeMillis();
-    state.getConnector().tableOperations().flush(indexTableName, null, null, true);
+    env.getConnector().tableOperations().flush(indexTableName, null, null, true);
     long t2 = System.currentTimeMillis();
-    state.getConnector().tableOperations().clone(indexTableName, tmpIndexTableName, false, new HashMap<String,String>(), new HashSet<String>());
+    env.getConnector().tableOperations().clone(indexTableName, tmpIndexTableName, false, new HashMap<String,String>(), new HashSet<String>());
     long t3 = System.currentTimeMillis();
     
     log.debug("Cloned " + tmpIndexTableName + " from " + indexTableName + " flush: " + (t2 - t1) + "ms clone: " + (t3 - t2) + "ms");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Commit.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Commit.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Commit.java
index b7ba825..8f928c7 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Commit.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Commit.java
@@ -18,14 +18,15 @@ package org.apache.accumulo.test.randomwalk.shard;
 
 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 Commit extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
-    state.getMultiTableBatchWriter().flush();
+  public void visit(State state, Environment env, Properties props) throws Exception {
+    env.getMultiTableBatchWriter().flush();
     log.debug("Committed inserts ");
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CompactFilter.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CompactFilter.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CompactFilter.java
index 4ed2513..96c6c62 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CompactFilter.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CompactFilter.java
@@ -30,6 +30,7 @@ import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.user.RegExFilter;
 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;
@@ -40,7 +41,7 @@ import org.apache.hadoop.io.Text;
 public class CompactFilter extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     String indexTableName = (String) state.get("indexTableName");
     String docTableName = (String) state.get("docTableName");
     Random rand = (Random) state.get("rand");
@@ -56,7 +57,7 @@ public class CompactFilter extends Test {
     documentFilters.add(is);
 
     long t1 = System.currentTimeMillis();
-    state.getConnector().tableOperations().compact(docTableName, null, null, documentFilters, true, true);
+    env.getConnector().tableOperations().compact(docTableName, null, null, documentFilters, true, true);
     long t2 = System.currentTimeMillis();
     long t3 = t2 - t1;
     
@@ -68,12 +69,12 @@ public class CompactFilter extends Test {
     indexFilters.add(is);
     
     t1 = System.currentTimeMillis();
-    state.getConnector().tableOperations().compact(indexTableName, null, null, indexFilters, true, true);
+    env.getConnector().tableOperations().compact(indexTableName, null, null, indexFilters, true, true);
     t2 = System.currentTimeMillis();
     
     log.debug("Filtered documents using compaction iterators " + regex + " " + (t3) + " " + (t2 - t1));
     
-    BatchScanner bscanner = state.getConnector().createBatchScanner(docTableName, new Authorizations(), 10);
+    BatchScanner bscanner = env.getConnector().createBatchScanner(docTableName, new Authorizations(), 10);
     
     List<Range> ranges = new ArrayList<Range>();
     for (int i = 0; i < 16; i++) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Delete.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Delete.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Delete.java
index b46be38..4931af5 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Delete.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Delete.java
@@ -23,35 +23,36 @@ import java.util.Random;
 import org.apache.accumulo.core.data.Key;
 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 Delete extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     String indexTableName = (String) state.get("indexTableName");
     String dataTableName = (String) state.get("docTableName");
     int numPartitions = (Integer) state.get("numPartitions");
     Random rand = (Random) state.get("rand");
     
-    Entry<Key,Value> entry = Search.findRandomDocument(state, dataTableName, rand);
+    Entry<Key,Value> entry = Search.findRandomDocument(state, env, dataTableName, rand);
     if (entry == null)
       return;
     
     String docID = entry.getKey().getRow().toString();
     String doc = entry.getValue().toString();
     
-    Insert.unindexDocument(state.getMultiTableBatchWriter().getBatchWriter(indexTableName), doc, docID, numPartitions);
+    Insert.unindexDocument(env.getMultiTableBatchWriter().getBatchWriter(indexTableName), doc, docID, numPartitions);
     
     Mutation m = new Mutation(docID);
     m.putDelete("doc", "");
     
-    state.getMultiTableBatchWriter().getBatchWriter(dataTableName).addMutation(m);
+    env.getMultiTableBatchWriter().getBatchWriter(dataTableName).addMutation(m);
     
     log.debug("Deleted document " + docID);
     
-    state.getMultiTableBatchWriter().flush();
+    env.getMultiTableBatchWriter().flush();
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteSomeDocs.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteSomeDocs.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteSomeDocs.java
index 9aa9e81..ed0a458 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteSomeDocs.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteSomeDocs.java
@@ -27,6 +27,7 @@ import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.iterators.user.RegExFilter;
 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;
 
@@ -34,7 +35,7 @@ import org.apache.accumulo.test.randomwalk.Test;
 public class DeleteSomeDocs extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     // delete documents that where the document id matches a given pattern from doc and index table
     // using the batch deleter
     
@@ -50,7 +51,7 @@ public class DeleteSomeDocs extends Test {
     
     String pattern = patterns.get(rand.nextInt(patterns.size()));
     BatchWriterConfig bwc = new BatchWriterConfig();
-    BatchDeleter ibd = state.getConnector().createBatchDeleter(indexTableName, Authorizations.EMPTY, 8, bwc);
+    BatchDeleter ibd = env.getConnector().createBatchDeleter(indexTableName, Authorizations.EMPTY, 8, bwc);
     ibd.setRanges(Collections.singletonList(new Range()));
     
     IteratorSetting iterSettings = new IteratorSetting(100, RegExFilter.class);
@@ -62,7 +63,7 @@ public class DeleteSomeDocs extends Test {
     
     ibd.close();
     
-    BatchDeleter dbd = state.getConnector().createBatchDeleter(dataTableName, Authorizations.EMPTY, 8, bwc);
+    BatchDeleter dbd = env.getConnector().createBatchDeleter(dataTableName, Authorizations.EMPTY, 8, bwc);
     dbd.setRanges(Collections.singletonList(new Range()));
     
     iterSettings = new IteratorSetting(100, RegExFilter.class);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteWord.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteWord.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteWord.java
index fa8917a..10bbff3 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteWord.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteWord.java
@@ -29,6 +29,7 @@ import org.apache.accumulo.core.data.Mutation;
 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;
 import org.apache.hadoop.io.Text;
@@ -41,7 +42,7 @@ import org.apache.hadoop.io.Text;
 public class DeleteWord extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     String indexTableName = (String) state.get("indexTableName");
     String docTableName = (String) state.get("docTableName");
     int numPartitions = (Integer) state.get("numPartitions");
@@ -50,7 +51,7 @@ public class DeleteWord extends Test {
     String wordToDelete = Insert.generateRandomWord(rand);
     
     // use index to find all documents containing word
-    Scanner scanner = state.getConnector().createScanner(indexTableName, Authorizations.EMPTY);
+    Scanner scanner = env.getConnector().createScanner(indexTableName, Authorizations.EMPTY);
     scanner.fetchColumnFamily(new Text(wordToDelete));
     
     ArrayList<Range> documentsToDelete = new ArrayList<Range>();
@@ -60,11 +61,11 @@ public class DeleteWord extends Test {
     
     if (documentsToDelete.size() > 0) {
       // use a batch scanner to fetch all documents
-      BatchScanner bscanner = state.getConnector().createBatchScanner(docTableName, Authorizations.EMPTY, 8);
+      BatchScanner bscanner = env.getConnector().createBatchScanner(docTableName, Authorizations.EMPTY, 8);
       bscanner.setRanges(documentsToDelete);
       
-      BatchWriter ibw = state.getMultiTableBatchWriter().getBatchWriter(indexTableName);
-      BatchWriter dbw = state.getMultiTableBatchWriter().getBatchWriter(docTableName);
+      BatchWriter ibw = env.getMultiTableBatchWriter().getBatchWriter(indexTableName);
+      BatchWriter dbw = env.getMultiTableBatchWriter().getBatchWriter(docTableName);
       
       int count = 0;
       
@@ -83,7 +84,7 @@ public class DeleteWord extends Test {
       
       bscanner.close();
       
-      state.getMultiTableBatchWriter().flush();
+      env.getMultiTableBatchWriter().flush();
       
       if (count != documentsToDelete.size()) {
         throw new Exception("Batch scanner did not return expected number of docs " + count + " " + documentsToDelete.size());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
index 812112e..989dca9 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
@@ -26,6 +26,7 @@ import java.util.Properties;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.conf.Property;
 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.fs.FileSystem;
@@ -39,7 +40,7 @@ import org.apache.hadoop.io.Text;
 public class ExportIndex extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     
     String indexTableName = (String) state.get("indexTableName");
     String tmpIndexTableName = indexTableName + "_tmp";
@@ -53,16 +54,16 @@ public class ExportIndex extends Test {
     fs.delete(new Path("/tmp/shard_export/" + tmpIndexTableName), true);
     
     // disable spits, so that splits can be compared later w/o worrying one table splitting and the other not
-    state.getConnector().tableOperations().setProperty(indexTableName, Property.TABLE_SPLIT_THRESHOLD.getKey(), "20G");
+    env.getConnector().tableOperations().setProperty(indexTableName, Property.TABLE_SPLIT_THRESHOLD.getKey(), "20G");
 
     long t1 = System.currentTimeMillis();
     
-    state.getConnector().tableOperations().flush(indexTableName, null, null, true);
-    state.getConnector().tableOperations().offline(indexTableName);
+    env.getConnector().tableOperations().flush(indexTableName, null, null, true);
+    env.getConnector().tableOperations().offline(indexTableName);
     
     long t2 = System.currentTimeMillis();
 
-    state.getConnector().tableOperations().exportTable(indexTableName, exportDir);
+    env.getConnector().tableOperations().exportTable(indexTableName, exportDir);
     
     long t3 = System.currentTimeMillis();
 
@@ -79,34 +80,34 @@ public class ExportIndex extends Test {
     
     long t4 = System.currentTimeMillis();
     
-    state.getConnector().tableOperations().online(indexTableName);
-    state.getConnector().tableOperations().importTable(tmpIndexTableName, copyDir);
+    env.getConnector().tableOperations().online(indexTableName);
+    env.getConnector().tableOperations().importTable(tmpIndexTableName, copyDir);
     
     long t5 = System.currentTimeMillis();
 
     fs.delete(new Path(exportDir), true);
     fs.delete(new Path(copyDir), true);
     
-    HashSet<Text> splits1 = new HashSet<Text>(state.getConnector().tableOperations().listSplits(indexTableName));
-    HashSet<Text> splits2 = new HashSet<Text>(state.getConnector().tableOperations().listSplits(tmpIndexTableName));
+    HashSet<Text> splits1 = new HashSet<Text>(env.getConnector().tableOperations().listSplits(indexTableName));
+    HashSet<Text> splits2 = new HashSet<Text>(env.getConnector().tableOperations().listSplits(tmpIndexTableName));
     
     if (!splits1.equals(splits2))
       throw new Exception("Splits not equals " + indexTableName + " " + tmpIndexTableName);
     
     HashMap<String,String> props1 = new HashMap<String,String>();
-    for (Entry<String,String> entry : state.getConnector().tableOperations().getProperties(indexTableName))
+    for (Entry<String,String> entry : env.getConnector().tableOperations().getProperties(indexTableName))
       props1.put(entry.getKey(), entry.getValue());
     
     HashMap<String,String> props2 = new HashMap<String,String>();
-    for (Entry<String,String> entry : state.getConnector().tableOperations().getProperties(tmpIndexTableName))
+    for (Entry<String,String> entry : env.getConnector().tableOperations().getProperties(tmpIndexTableName))
       props2.put(entry.getKey(), entry.getValue());
     
     if (!props1.equals(props2))
       throw new Exception("Props not equals " + indexTableName + " " + tmpIndexTableName);
 
     // unset the split threshold
-    state.getConnector().tableOperations().removeProperty(indexTableName, Property.TABLE_SPLIT_THRESHOLD.getKey());
-    state.getConnector().tableOperations().removeProperty(tmpIndexTableName, Property.TABLE_SPLIT_THRESHOLD.getKey());
+    env.getConnector().tableOperations().removeProperty(indexTableName, Property.TABLE_SPLIT_THRESHOLD.getKey());
+    env.getConnector().tableOperations().removeProperty(tmpIndexTableName, Property.TABLE_SPLIT_THRESHOLD.getKey());
 
     log.debug("Imported " + tmpIndexTableName + " from " + indexTableName + " flush: " + (t2 - t1) + "ms export: " + (t3 - t2) + "ms copy:" + (t4 - t3)
         + "ms import:" + (t5 - t4) + "ms");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Flush.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Flush.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Flush.java
index 4496b71..5bd4354 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Flush.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Flush.java
@@ -19,13 +19,14 @@ package org.apache.accumulo.test.randomwalk.shard;
 import java.util.Properties;
 import java.util.Random;
 
+import org.apache.accumulo.test.randomwalk.Environment;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
 public class Flush extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     String indexTableName = (String) state.get("indexTableName");
     String dataTableName = (String) state.get("docTableName");
     Random rand = (Random) state.get("rand");
@@ -37,7 +38,7 @@ public class Flush extends Test {
     else
       table = dataTableName;
     
-    state.getConnector().tableOperations().flush(table, null, null, true);
+    env.getConnector().tableOperations().flush(table, null, null, true);
     log.debug("Flushed " + table);
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Grep.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Grep.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Grep.java
index 6b674ed..66d53d8 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Grep.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Grep.java
@@ -31,6 +31,7 @@ import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.user.IntersectingIterator;
 import org.apache.accumulo.core.iterators.user.RegExFilter;
 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;
@@ -38,7 +39,7 @@ import org.apache.hadoop.io.Text;
 public class Grep extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     // pick a few randoms words... grep for those words and search the index
     // ensure both return the same set of documents
     
@@ -52,7 +53,7 @@ public class Grep extends Test {
       words[i] = new Text(Insert.generateRandomWord(rand));
     }
     
-    BatchScanner bs = state.getConnector().createBatchScanner(indexTableName, Authorizations.EMPTY, 16);
+    BatchScanner bs = env.getConnector().createBatchScanner(indexTableName, Authorizations.EMPTY, 16);
     IteratorSetting ii = new IteratorSetting(20, "ii", IntersectingIterator.class.getName());
     IntersectingIterator.setColumnFamilies(ii, words);
     bs.addScanIterator(ii);
@@ -66,7 +67,7 @@ public class Grep extends Test {
     
     bs.close();
     
-    bs = state.getConnector().createBatchScanner(dataTableName, Authorizations.EMPTY, 16);
+    bs = env.getConnector().createBatchScanner(dataTableName, Authorizations.EMPTY, 16);
     
     for (int i = 0; i < words.length; i++) {
       IteratorSetting more = new IteratorSetting(20 + i, "ii" + i, RegExFilter.class);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
index 8e81acb..71d355b 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
@@ -26,6 +26,7 @@ import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.TableNotFoundException;
 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;
 
@@ -36,15 +37,15 @@ public class Insert extends Test {
   static final int MAX_WORDS_PER_DOC = 3000;
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     String indexTableName = (String) state.get("indexTableName");
     String dataTableName = (String) state.get("docTableName");
     int numPartitions = (Integer) state.get("numPartitions");
     Random rand = (Random) state.get("rand");
     long nextDocID = (Long) state.get("nextDocID");
     
-    BatchWriter dataWriter = state.getMultiTableBatchWriter().getBatchWriter(dataTableName);
-    BatchWriter indexWriter = state.getMultiTableBatchWriter().getBatchWriter(indexTableName);
+    BatchWriter dataWriter = env.getMultiTableBatchWriter().getBatchWriter(dataTableName);
+    BatchWriter indexWriter = env.getMultiTableBatchWriter().getBatchWriter(indexTableName);
     
     String docID = insertRandomDocument(nextDocID++, dataWriter, indexWriter, indexTableName, dataTableName, numPartitions, rand);
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Merge.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Merge.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Merge.java
index 8e6eee3..0c4fa3f 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Merge.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Merge.java
@@ -21,6 +21,7 @@ import java.util.Properties;
 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.accumulo.test.randomwalk.Test;
 import org.apache.hadoop.io.Text;
@@ -28,16 +29,16 @@ import org.apache.hadoop.io.Text;
 public class Merge extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     String indexTableName = (String) state.get("indexTableName");
     
-    Collection<Text> splits = state.getConnector().tableOperations().listSplits(indexTableName);
+    Collection<Text> splits = env.getConnector().tableOperations().listSplits(indexTableName);
     SortedSet<Text> splitSet = new TreeSet<Text>(splits);
     log.debug("merging " + indexTableName);
-    state.getConnector().tableOperations().merge(indexTableName, null, null);
+    env.getConnector().tableOperations().merge(indexTableName, null, null);
     org.apache.accumulo.core.util.Merge merge = new org.apache.accumulo.core.util.Merge();
-    merge.mergomatic(state.getConnector(), indexTableName, null, null, 256 * 1024 * 1024, true);
-    splits = state.getConnector().tableOperations().listSplits(indexTableName);
+    merge.mergomatic(env.getConnector(), indexTableName, null, null, 256 * 1024 * 1024, true);
+    splits = env.getConnector().tableOperations().listSplits(indexTableName);
     if (splits.size() > splitSet.size()) {
       // throw an excpetion so that test will die an no further changes to table will occur...
       // this way table is left as is for debugging.

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Reindex.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Reindex.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Reindex.java
index 066ce27..de26b76 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Reindex.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Reindex.java
@@ -26,13 +26,14 @@ 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;
 
 public class Reindex extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     String indexTableName = (String) state.get("indexTableName");
     String tmpIndexTableName = indexTableName + "_tmp";
     String docTableName = (String) state.get("docTableName");
@@ -40,10 +41,10 @@ public class Reindex extends Test {
     
     Random rand = (Random) state.get("rand");
     
-    ShardFixture.createIndexTable(this.log, state, "_tmp", rand);
+    ShardFixture.createIndexTable(this.log, state, env, "_tmp", rand);
     
-    Scanner scanner = state.getConnector().createScanner(docTableName, Authorizations.EMPTY);
-    BatchWriter tbw = state.getConnector().createBatchWriter(tmpIndexTableName, new BatchWriterConfig());
+    Scanner scanner = env.getConnector().createScanner(docTableName, Authorizations.EMPTY);
+    BatchWriter tbw = env.getConnector().createBatchWriter(tmpIndexTableName, new BatchWriterConfig());
     
     int count = 0;
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Search.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Search.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Search.java
index ecd4061..c8888a1 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Search.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Search.java
@@ -31,6 +31,7 @@ import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.user.IntersectingIterator;
 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;
@@ -38,13 +39,13 @@ import org.apache.hadoop.io.Text;
 public class Search extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     String indexTableName = (String) state.get("indexTableName");
     String dataTableName = (String) state.get("docTableName");
     
     Random rand = (Random) state.get("rand");
     
-    Entry<Key,Value> entry = findRandomDocument(state, dataTableName, rand);
+    Entry<Key,Value> entry = findRandomDocument(state, env, dataTableName, rand);
     if (entry == null)
       return;
     
@@ -68,7 +69,7 @@ public class Search extends Test {
     
     log.debug("Looking up terms " + searchTerms + " expect to find " + docID);
     
-    BatchScanner bs = state.getConnector().createBatchScanner(indexTableName, Authorizations.EMPTY, 10);
+    BatchScanner bs = env.getConnector().createBatchScanner(indexTableName, Authorizations.EMPTY, 10);
     IteratorSetting ii = new IteratorSetting(20, "ii", IntersectingIterator.class);
     IntersectingIterator.setColumnFamilies(ii, columns);
     bs.addScanIterator(ii);
@@ -89,8 +90,8 @@ public class Search extends Test {
       throw new Exception("Did not see doc " + docID + " in index.  terms:" + searchTerms + " " + indexTableName + " " + dataTableName);
   }
   
-  static Entry<Key,Value> findRandomDocument(State state, String dataTableName, Random rand) throws Exception {
-    Scanner scanner = state.getConnector().createScanner(dataTableName, Authorizations.EMPTY);
+  static Entry<Key,Value> findRandomDocument(State state, Environment env, String dataTableName, Random rand) throws Exception {
+    Scanner scanner = env.getConnector().createScanner(dataTableName, Authorizations.EMPTY);
     scanner.setBatchSize(1);
     scanner.setRange(new Range(Integer.toString(rand.nextInt(0xfffffff), 16), null));
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
index ccf4f35..99529e2 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
@@ -26,6 +26,7 @@ import org.apache.accumulo.core.client.MultiTableBatchWriter;
 import org.apache.accumulo.core.client.MutationsRejectedException;
 import org.apache.accumulo.core.conf.Property;
 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;
 import org.apache.log4j.Logger;
@@ -48,8 +49,8 @@ public class ShardFixture extends Fixture {
     return splits;
   }
   
-  static void createIndexTable(Logger log, State state, String suffix, Random rand) throws Exception {
-    Connector conn = state.getConnector();
+  static void createIndexTable(Logger log, State state, Environment env, String suffix, Random rand) throws Exception {
+    Connector conn = env.getConnector();
     String name = (String) state.get("indexTableName") + suffix;
     int numPartitions = (Integer) state.get("numPartitions");
     boolean enableCache = (Boolean) state.get("cacheIndex");
@@ -65,9 +66,9 @@ public class ShardFixture extends Fixture {
   }
   
   @Override
-  public void setUp(State state) throws Exception {
+  public void setUp(State state, Environment env) throws Exception {
     String hostname = InetAddress.getLocalHost().getHostName().replaceAll("[-.]", "_");
-    String pid = state.getPid();
+    String pid = env.getPid();
     
     Random rand = new Random();
     
@@ -80,9 +81,9 @@ public class ShardFixture extends Fixture {
     state.set("rand", rand);
     state.set("nextDocID", Long.valueOf(0));
     
-    Connector conn = state.getConnector();
+    Connector conn = env.getConnector();
     
-    createIndexTable(this.log, state, "", rand);
+    createIndexTable(this.log, state, env, "", rand);
     
     String docTableName = (String) state.get("docTableName");
     conn.tableOperations().create(docTableName);
@@ -95,10 +96,10 @@ public class ShardFixture extends Fixture {
   }
   
   @Override
-  public void tearDown(State state) throws Exception {
+  public void tearDown(State state, Environment env) throws Exception {
     // We have resources we need to clean up
-    if (state.isMultiTableBatchWriterInitialized()) {
-      MultiTableBatchWriter mtbw = state.getMultiTableBatchWriter();
+    if (env.isMultiTableBatchWriterInitialized()) {
+      MultiTableBatchWriter mtbw = env.getMultiTableBatchWriter();
       try {
         mtbw.close();
       } catch (MutationsRejectedException e) {
@@ -106,10 +107,10 @@ public class ShardFixture extends Fixture {
       }
       
       // Reset the MTBW on the state to null
-      state.resetMultiTableBatchWriter();
+      env.resetMultiTableBatchWriter();
     }
     
-    Connector conn = state.getConnector();
+    Connector conn = env.getConnector();
     
     conn.tableOperations().delete((String) state.get("indexTableName"));
     conn.tableOperations().delete((String) state.get("docTableName"));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Split.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Split.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Split.java
index 0d41316..6c6ab00 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Split.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Split.java
@@ -20,6 +20,7 @@ import java.util.Properties;
 import java.util.Random;
 import java.util.SortedSet;
 
+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;
@@ -27,14 +28,14 @@ import org.apache.hadoop.io.Text;
 public class Split extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     String indexTableName = (String) state.get("indexTableName");
     int numPartitions = (Integer) state.get("numPartitions");
     Random rand = (Random) state.get("rand");
     
     SortedSet<Text> splitSet = ShardFixture.genSplits(numPartitions, rand.nextInt(numPartitions) + 1, "%06x");
     log.debug("adding splits " + indexTableName);
-    state.getConnector().tableOperations().addSplits(indexTableName, splitSet);
+    env.getConnector().tableOperations().addSplits(indexTableName, splitSet);
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/VerifyIndex.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/VerifyIndex.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/VerifyIndex.java
index 8696321..c6f5703 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/VerifyIndex.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/VerifyIndex.java
@@ -25,20 +25,21 @@ import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.PartialKey;
 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 VerifyIndex extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {
+  public void visit(State state, Environment env, Properties props) throws Exception {
     
     String indexTableName = (String) state.get("indexTableName");
     String tmpIndexTableName = indexTableName + "_tmp";
     
     // scan new and old index and verify identical
-    Scanner indexScanner1 = state.getConnector().createScanner(tmpIndexTableName, Authorizations.EMPTY);
-    Scanner indexScanner2 = state.getConnector().createScanner(indexTableName, Authorizations.EMPTY);
+    Scanner indexScanner1 = env.getConnector().createScanner(tmpIndexTableName, Authorizations.EMPTY);
+    Scanner indexScanner2 = env.getConnector().createScanner(indexTableName, Authorizations.EMPTY);
     
     Iterator<Entry<Key,Value>> iter = indexScanner2.iterator();
     
@@ -63,8 +64,8 @@ public class VerifyIndex extends Test {
     
     log.debug("Verified " + count + " index entries ");
     
-    state.getConnector().tableOperations().delete(indexTableName);
-    state.getConnector().tableOperations().rename(tmpIndexTableName, indexTableName);
+    env.getConnector().tableOperations().delete(indexTableName);
+    env.getConnector().tableOperations().rename(tmpIndexTableName, indexTableName);
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/CreateTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/CreateTable.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/CreateTable.java
index 12584f7..1d1e926 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/CreateTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/CreateTable.java
@@ -19,11 +19,12 @@ package org.apache.accumulo.test.randomwalk.unit;
 
 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 CreateTable extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {}
+  public void visit(State state, Environment env, Properties props) throws Exception {}
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/DeleteTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/DeleteTable.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/DeleteTable.java
index 20ad3db..379a17d 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/DeleteTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/DeleteTable.java
@@ -18,11 +18,12 @@ package org.apache.accumulo.test.randomwalk.unit;
 
 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 DeleteTable extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {}
+  public void visit(State state, Environment env, Properties props) throws Exception {}
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Ingest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Ingest.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Ingest.java
index 045a3ee..461ef22 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Ingest.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Ingest.java
@@ -18,11 +18,12 @@ package org.apache.accumulo.test.randomwalk.unit;
 
 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 Ingest extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {}
+  public void visit(State state, Environment env, Properties props) throws Exception {}
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Scan.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Scan.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Scan.java
index 06cb62b..bd82b39 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Scan.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Scan.java
@@ -18,11 +18,12 @@ package org.apache.accumulo.test.randomwalk.unit;
 
 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 Scan extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {}
+  public void visit(State state, Environment env, Properties props) throws Exception {}
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a74f392e/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Verify.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Verify.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Verify.java
index 6c1b7a2..1b2f4cf 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Verify.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/unit/Verify.java
@@ -18,11 +18,12 @@ package org.apache.accumulo.test.randomwalk.unit;
 
 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 Verify extends Test {
   
   @Override
-  public void visit(State state, Properties props) throws Exception {}
+  public void visit(State state, Environment env, Properties props) throws Exception {}
 }


Mime
View raw message