accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmil...@apache.org
Subject [accumulo-testing] branch master updated: Replace Connector with AccumuloClient (#34)
Date Mon, 24 Sep 2018 18:29:36 GMT
This is an automated email from the ASF dual-hosted git repository.

mmiller pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo-testing.git


The following commit(s) were added to refs/heads/master by this push:
     new 27216f4  Replace Connector with AccumuloClient (#34)
27216f4 is described below

commit 27216f4a09995a0978d9901b7515bbd14b9de82f
Author: Mike Miller <mmiller@apache.org>
AuthorDate: Mon Sep 24 14:29:32 2018 -0400

    Replace Connector with AccumuloClient (#34)
---
 .../accumulo/testing/core/continuous/UndefinedAnalyzer.java  |  3 ++-
 .../accumulo/testing/core/ingest/BulkImportDirectory.java    |  2 +-
 .../org/apache/accumulo/testing/core/ingest/TestIngest.java  |  9 +++++----
 .../apache/accumulo/testing/core/ingest/VerifyIngest.java    |  5 +++--
 .../accumulo/testing/core/merkle/cli/CompareTables.java      |  8 ++++----
 .../accumulo/testing/core/merkle/cli/ComputeRootHash.java    |  7 ++++---
 .../accumulo/testing/core/merkle/cli/GenerateHashes.java     |  9 +++++----
 .../accumulo/testing/core/merkle/cli/ManualComparison.java   |  3 ++-
 .../accumulo/testing/core/merkle/ingest/RandomWorkload.java  |  5 +++--
 .../testing/core/performance/impl/PerfTestRunner.java        |  6 ++++--
 .../apache/accumulo/testing/core/randomwalk/bulk/Verify.java |  2 +-
 .../testing/core/randomwalk/concurrent/Replication.java      |  8 ++++----
 .../apache/accumulo/testing/core/randomwalk/shard/Merge.java |  3 ++-
 .../org/apache/accumulo/testing/core/scalability/Ingest.java |  8 ++++----
 .../apache/accumulo/testing/core/scalability/ScaleTest.java  | 12 +++++-------
 .../java/org/apache/accumulo/testing/core/stress/Scan.java   |  3 ++-
 .../java/org/apache/accumulo/testing/core/stress/Write.java  |  3 ++-
 .../testing/core/randomwalk/ReplicationRandomWalkIT.java     |  2 +-
 18 files changed, 54 insertions(+), 44 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/testing/core/continuous/UndefinedAnalyzer.java
b/core/src/main/java/org/apache/accumulo/testing/core/continuous/UndefinedAnalyzer.java
index 30eae92..70df0c0 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/continuous/UndefinedAnalyzer.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/continuous/UndefinedAnalyzer.java
@@ -36,6 +36,7 @@ import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.accumulo.core.cli.BatchScannerOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.BatchScanner;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.data.Key;
@@ -280,7 +281,7 @@ public class UndefinedAnalyzer {
       undefs.add(new UndefinedNode(undef, ref));
     }
 
-    Connector conn = opts.getConnector();
+    AccumuloClient conn = opts.getClient();
     BatchScanner bscanner = conn.createBatchScanner(opts.getTableName(), opts.auths, bsOpts.scanThreads);
     bscanner.setTimeout(bsOpts.scanTimeout, TimeUnit.MILLISECONDS);
     List<Range> refs = new ArrayList<>();
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/ingest/BulkImportDirectory.java
b/core/src/main/java/org/apache/accumulo/testing/core/ingest/BulkImportDirectory.java
index a189eda..e5617c4 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/ingest/BulkImportDirectory.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/ingest/BulkImportDirectory.java
@@ -43,6 +43,6 @@ public class BulkImportDirectory {
     opts.parseArgs(BulkImportDirectory.class.getName(), args);
     fs.delete(new Path(opts.failures), true);
     fs.mkdirs(new Path(opts.failures));
-    opts.getConnector().tableOperations().importDirectory(opts.getTableName(), opts.source,
opts.failures, false);
+    opts.getClient().tableOperations().importDirectory(opts.getTableName(), opts.source,
opts.failures, false);
   }
 }
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/ingest/TestIngest.java b/core/src/main/java/org/apache/accumulo/testing/core/ingest/TestIngest.java
index d30120d..2d43bee 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/ingest/TestIngest.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/ingest/TestIngest.java
@@ -26,6 +26,7 @@ import java.util.TreeSet;
 
 import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.cli.ClientOnDefaultTable;
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchWriter;
@@ -110,7 +111,7 @@ public class TestIngest {
     }
   }
 
-  public static void createTable(Connector conn, Opts args) throws AccumuloException, AccumuloSecurityException,
TableExistsException {
+  public static void createTable(AccumuloClient conn, Opts args) throws AccumuloException,
AccumuloSecurityException, TableExistsException {
     if (args.createTable) {
       TreeSet<Text> splits = getSplitPoints(args.startRow, args.startRow + args.rows,
args.numsplits);
 
@@ -192,7 +193,7 @@ public class TestIngest {
 
       // test batch update
 
-      ingest(opts.getConnector(), opts, bwOpts);
+      ingest(opts.getClient(), opts, bwOpts);
     } catch (Exception e) {
       throw new RuntimeException(e);
     } finally {
@@ -201,7 +202,7 @@ public class TestIngest {
     }
   }
 
-  public static void ingest(Connector connector, FileSystem fs, Opts opts, BatchWriterOpts
bwOpts) throws IOException, AccumuloException,
+  public static void ingest(AccumuloClient connector, FileSystem fs, Opts opts, BatchWriterOpts
bwOpts) throws IOException, AccumuloException,
       AccumuloSecurityException, TableNotFoundException, MutationsRejectedException, TableExistsException
{
     long stopTime;
 
@@ -338,7 +339,7 @@ public class TestIngest {
         (int) (totalValues / elapsed), bytesWritten, (int) (bytesWritten / elapsed), elapsed);
   }
 
-  public static void ingest(Connector c, Opts opts, BatchWriterOpts batchWriterOpts) throws
MutationsRejectedException, IOException, AccumuloException,
+  public static void ingest(AccumuloClient c, Opts opts, BatchWriterOpts batchWriterOpts)
throws MutationsRejectedException, IOException, AccumuloException,
       AccumuloSecurityException, TableNotFoundException, TableExistsException {
     ingest(c, FileSystem.get(CachedConfiguration.getInstance()), opts, batchWriterOpts);
   }
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/ingest/VerifyIngest.java
b/core/src/main/java/org/apache/accumulo/testing/core/ingest/VerifyIngest.java
index 4f8862a..be3de45 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/ingest/VerifyIngest.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/ingest/VerifyIngest.java
@@ -22,6 +22,7 @@ import java.util.Map.Entry;
 import java.util.Random;
 
 import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
@@ -69,7 +70,7 @@ public class VerifyIngest {
         Trace.data("cmdLine", Arrays.asList(args).toString());
       }
 
-      verifyIngest(opts.getConnector(), opts, scanOpts);
+      verifyIngest(opts.getClient(), opts, scanOpts);
 
     } finally {
       Trace.off();
@@ -77,7 +78,7 @@ public class VerifyIngest {
     }
   }
 
-  public static void verifyIngest(Connector connector, Opts opts, ScannerOpts scanOpts) throws
AccumuloException, AccumuloSecurityException,
+  public static void verifyIngest(AccumuloClient connector, Opts opts, ScannerOpts scanOpts)
throws AccumuloException, AccumuloSecurityException,
       TableNotFoundException {
     byte[][] bytevals = TestIngest.generateValues(opts.dataSize);
 
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/CompareTables.java
b/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/CompareTables.java
index 2825071..7af352e 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/CompareTables.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/CompareTables.java
@@ -28,7 +28,7 @@ import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.cli.ClientOpts;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.data.Range;
@@ -114,7 +114,7 @@ public class CompareTables {
 
   public Map<String,String> computeAllHashes() throws AccumuloException, AccumuloSecurityException,
TableExistsException, NoSuchAlgorithmException,
       TableNotFoundException, FileNotFoundException {
-    final Connector conn = opts.getConnector();
+    final AccumuloClient conn = opts.getClient();
     final Map<String,String> hashesByTable = new HashMap<>();
 
     for (String table : opts.getTables()) {
@@ -127,10 +127,10 @@ public class CompareTables {
       conn.tableOperations().create(outputTableName);
 
       GenerateHashes genHashes = new GenerateHashes();
-      Collection<Range> ranges = genHashes.getRanges(opts.getConnector(), table, opts.getSplitsFile());
+      Collection<Range> ranges = genHashes.getRanges(opts.getClient(), table, opts.getSplitsFile());
 
       try {
-        genHashes.run(opts.getConnector(), table, table + "_merkle", opts.getHashName(),
opts.getNumThreads(), opts.isIteratorPushdown(), ranges);
+        genHashes.run(opts.getClient(), table, table + "_merkle", opts.getHashName(), opts.getNumThreads(),
opts.isIteratorPushdown(), ranges);
       } catch (Exception e) {
         log.error("Error generating hashes for {}", table, e);
         throw new RuntimeException(e);
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/ComputeRootHash.java
b/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/ComputeRootHash.java
index a988c8b..a2286bb 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/ComputeRootHash.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/ComputeRootHash.java
@@ -23,6 +23,7 @@ import java.util.List;
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.cli.ClientOnRequiredTable;
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
@@ -59,13 +60,13 @@ public class ComputeRootHash {
   }
 
   public byte[] getHash(ComputeRootHashOpts opts) throws AccumuloException, AccumuloSecurityException,
TableNotFoundException, NoSuchAlgorithmException {
-    Connector conn = opts.getConnector();
+    AccumuloClient conn = opts.getClient();
     String table = opts.getTableName();
 
     return getHash(conn, table, opts.getHashName());
   }
 
-  public byte[] getHash(Connector conn, String table, String hashName) throws TableNotFoundException,
NoSuchAlgorithmException {
+  public byte[] getHash(AccumuloClient conn, String table, String hashName) throws TableNotFoundException,
NoSuchAlgorithmException {
     List<MerkleTreeNode> leaves = getLeaves(conn, table);
 
     MerkleTree tree = new MerkleTree(leaves, hashName);
@@ -73,7 +74,7 @@ public class ComputeRootHash {
     return tree.getRootNode().getHash();
   }
 
-  protected ArrayList<MerkleTreeNode> getLeaves(Connector conn, String tableName) throws
TableNotFoundException {
+  protected ArrayList<MerkleTreeNode> getLeaves(AccumuloClient conn, String tableName)
throws TableNotFoundException {
     // TODO make this a bit more resilient to very large merkle trees by
     // lazily reading more data from the table when necessary
     final Scanner s = conn.createScanner(tableName, Authorizations.EMPTY);
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/GenerateHashes.java
b/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/GenerateHashes.java
index 65f61a8..4c9ac70 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/GenerateHashes.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/GenerateHashes.java
@@ -34,6 +34,7 @@ import java.util.concurrent.Executors;
 
 import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.cli.ClientOnRequiredTable;
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchWriter;
@@ -121,7 +122,7 @@ public class GenerateHashes {
     }
   }
 
-  public Collection<Range> getRanges(Connector conn, String tableName, String splitsFile)
throws TableNotFoundException, AccumuloSecurityException,
+  public Collection<Range> getRanges(AccumuloClient conn, String tableName, String
splitsFile) throws TableNotFoundException, AccumuloSecurityException,
       AccumuloException, FileNotFoundException {
     if (null == splitsFile) {
       log.info("Using table split points");
@@ -151,12 +152,12 @@ public class GenerateHashes {
 
   public void run(GenerateHashesOpts opts) throws TableNotFoundException, AccumuloSecurityException,
AccumuloException, NoSuchAlgorithmException,
       FileNotFoundException {
-    Collection<Range> ranges = getRanges(opts.getConnector(), opts.getTableName(),
opts.getSplitsFile());
+    Collection<Range> ranges = getRanges(opts.getClient(), opts.getTableName(), opts.getSplitsFile());
 
-    run(opts.getConnector(), opts.getTableName(), opts.getOutputTableName(), opts.getHashName(),
opts.getNumThreads(), opts.isIteratorPushdown(), ranges);
+    run(opts.getClient(), opts.getTableName(), opts.getOutputTableName(), opts.getHashName(),
opts.getNumThreads(), opts.isIteratorPushdown(), ranges);
   }
 
-  public void run(final Connector conn, final String inputTableName, final String outputTableName,
final String digestName, int numThreads,
+  public void run(final AccumuloClient conn, final String inputTableName, final String outputTableName,
final String digestName, int numThreads,
       final boolean iteratorPushdown, final Collection<Range> ranges) throws TableNotFoundException,
AccumuloSecurityException, AccumuloException,
       NoSuchAlgorithmException {
     if (!conn.tableOperations().exists(outputTableName)) {
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/ManualComparison.java
b/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/ManualComparison.java
index 87489f6..5531d81 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/ManualComparison.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/merkle/cli/ManualComparison.java
@@ -20,6 +20,7 @@ import java.util.Iterator;
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.cli.ClientOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.data.Key;
@@ -46,7 +47,7 @@ public class ManualComparison {
     ManualComparisonOpts opts = new ManualComparisonOpts();
     opts.parseArgs("ManualComparison", args);
 
-    Connector conn = opts.getConnector();
+    AccumuloClient conn = opts.getClient();
 
     Scanner s1 = conn.createScanner(opts.table1, Authorizations.EMPTY), s2 = conn.createScanner(opts.table2,
Authorizations.EMPTY);
     Iterator<Entry<Key,Value>> iter1 = s1.iterator(), iter2 = s2.iterator();
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/merkle/ingest/RandomWorkload.java
b/core/src/main/java/org/apache/accumulo/testing/core/merkle/ingest/RandomWorkload.java
index 9d38713..2a0f26d 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/merkle/ingest/RandomWorkload.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/merkle/ingest/RandomWorkload.java
@@ -20,6 +20,7 @@ import java.util.Random;
 
 import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.cli.ClientOnDefaultTable;
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Connector;
@@ -61,10 +62,10 @@ public class RandomWorkload {
   }
 
   public void run(RandomWorkloadOpts opts, BatchWriterConfig cfg) throws Exception {
-    run(opts.getConnector(), opts.getTableName(), cfg, opts.numRecords, opts.rowMax, opts.cfMax,
opts.cqMax, opts.deletePercent);
+    run(opts.getClient(), opts.getTableName(), cfg, opts.numRecords, opts.rowMax, opts.cfMax,
opts.cqMax, opts.deletePercent);
   }
 
-  public void run(final Connector conn, final String tableName, final BatchWriterConfig cfg,
final long numRecords, int rowMax, int cfMax, int cqMax,
+  public void run(final AccumuloClient conn, final String tableName, final BatchWriterConfig
cfg, final long numRecords, int rowMax, int cfMax, int cqMax,
       int deletePercent) throws Exception {
 
     final Random rowRand = new Random(12345);
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/performance/impl/PerfTestRunner.java
b/core/src/main/java/org/apache/accumulo/testing/core/performance/impl/PerfTestRunner.java
index 4ce6b1a..bbca0f3 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/performance/impl/PerfTestRunner.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/performance/impl/PerfTestRunner.java
@@ -25,6 +25,8 @@ import java.time.Instant;
 import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
 
+import org.apache.accumulo.core.client.Accumulo;
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.testing.core.performance.Environment;
 import org.apache.accumulo.testing.core.performance.PerformanceTest;
@@ -42,14 +44,14 @@ public class PerfTestRunner {
 
     PerformanceTest perfTest = Class.forName(className).asSubclass(PerformanceTest.class).newInstance();
 
-    Connector conn = Connector.builder().usingProperties(clientProps).build();
+    AccumuloClient client = Accumulo.newClient().usingProperties(clientProps).build();
 
     Instant start = Instant.now();
 
     Report result = perfTest.runTest(new Environment() {
       @Override
       public Connector getConnector() {
-        return conn;
+        return Connector.from(client);
       }
     });
 
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/Verify.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/Verify.java
index 885be06..998a38d 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/Verify.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/Verify.java
@@ -106,7 +106,7 @@ public class Verify extends Test {
   public static void main(String args[]) throws Exception {
     ClientOnRequiredTable opts = new ClientOnRequiredTable();
     opts.parseArgs(Verify.class.getName(), args);
-    Scanner scanner = opts.getConnector().createScanner(opts.getTableName(), opts.auths);
+    Scanner scanner = opts.getClient().createScanner(opts.getTableName(), opts.auths);
     scanner.fetchColumnFamily(BulkPlusOne.CHECK_COLUMN_FAMILY);
     Text startBadRow = null;
     Text lastBadRow = null;
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/concurrent/Replication.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/concurrent/Replication.java
index 8033eda..9324861 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/concurrent/Replication.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/concurrent/Replication.java
@@ -38,6 +38,7 @@ import java.util.TreeSet;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Instance;
@@ -62,15 +63,14 @@ public class Replication extends Test {
 
   @Override
   public void visit(State state, RandWalkEnv env, Properties props) throws Exception {
-    final Connector c = env.getAccumuloConnector();
-    final Instance inst = c.getInstance();
-    final String instName = inst.getInstanceName();
+    final AccumuloClient c = (AccumuloClient) env.getAccumuloConnector();
+    final String instName = c.info().getInstanceName();
     final InstanceOperations iOps = c.instanceOperations();
     final TableOperations tOps = c.tableOperations();
 
     // Replicate to ourselves
     iOps.setProperty(REPLICATION_NAME.getKey(), instName);
-    iOps.setProperty(REPLICATION_PEERS.getKey() + instName, getPeerConfigurationValue(AccumuloReplicaSystem.class,
instName + "," + inst.getZooKeepers()));
+    iOps.setProperty(REPLICATION_PEERS.getKey() + instName, getPeerConfigurationValue(AccumuloReplicaSystem.class,
instName + "," + c.info().getZooKeepers()));
     iOps.setProperty(REPLICATION_PEER_USER.getKey() + instName, env.getAccumuloUserName());
     iOps.setProperty(REPLICATION_PEER_PASSWORD.getKey() + instName, env.getAccumuloPassword());
     // Tweak some replication parameters to make the replication go faster
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/shard/Merge.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/shard/Merge.java
index 9f97135..ecd54ec 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/shard/Merge.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/shard/Merge.java
@@ -21,6 +21,7 @@ import java.util.Properties;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.testing.core.randomwalk.RandWalkEnv;
 import org.apache.accumulo.testing.core.randomwalk.State;
 import org.apache.accumulo.testing.core.randomwalk.Test;
@@ -37,7 +38,7 @@ public class Merge extends Test {
     log.debug("merging " + indexTableName);
     env.getAccumuloConnector().tableOperations().merge(indexTableName, null, null);
     org.apache.accumulo.core.util.Merge merge = new org.apache.accumulo.core.util.Merge();
-    merge.mergomatic(env.getAccumuloConnector(), indexTableName, null, null, 256 * 1024 *
1024, true);
+    merge.mergomatic((AccumuloClient) env.getAccumuloConnector(), indexTableName, null, null,
256 * 1024 * 1024, true);
     splits = env.getAccumuloConnector().tableOperations().listSplits(indexTableName);
     if (splits.size() > splitSet.size()) {
       // throw an excpetion so that test will die an no further changes to
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/scalability/Ingest.java b/core/src/main/java/org/apache/accumulo/testing/core/scalability/Ingest.java
index 1a61eea..2f4667c 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/scalability/Ingest.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/scalability/Ingest.java
@@ -22,9 +22,9 @@ import java.util.Random;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.MutationsRejectedException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.data.Mutation;
@@ -40,7 +40,7 @@ public class Ingest extends ScaleTest {
   @Override
   public void setup() {
 
-    Connector conn = getConnector();
+    AccumuloClient conn = getClient();
     String tableName = getTestProperty("TABLE");
 
     // delete existing table
@@ -67,7 +67,7 @@ public class Ingest extends ScaleTest {
   @Override
   public void client() {
 
-    Connector conn = getConnector();
+    AccumuloClient conn = getClient();
     String tableName = getTestProperty("TABLE");
 
     // get batch writer configuration
@@ -130,7 +130,7 @@ public class Ingest extends ScaleTest {
   @Override
   public void teardown() {
 
-    Connector conn = getConnector();
+    AccumuloClient conn = getClient();
     String tableName = getTestProperty("TABLE");
 
     try {
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/scalability/ScaleTest.java
b/core/src/main/java/org/apache/accumulo/testing/core/scalability/ScaleTest.java
index 4ed19a0..52e034d 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/scalability/ScaleTest.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/scalability/ScaleTest.java
@@ -19,17 +19,16 @@ package org.apache.accumulo.testing.core.scalability;
 import java.util.Properties;
 import java.util.TreeSet;
 
+import org.apache.accumulo.core.client.Accumulo;
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.ClientConfiguration;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.ZooKeeperInstance;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.hadoop.io.Text;
 
 public abstract class ScaleTest {
 
-  private Connector conn;
+  private AccumuloClient conn;
   private Properties scaleProps;
   private Properties testProps;
   private int numTabletServers;
@@ -48,8 +47,7 @@ public abstract class ScaleTest {
     String password = this.scaleProps.getProperty("PASSWORD");
     System.out.println(password);
 
-    conn = new ZooKeeperInstance(ClientConfiguration.create().withInstance(instanceName).withZkHosts(zookeepers)).getConnector(user,
-        new PasswordToken(password));
+    conn = Accumulo.newClient().forInstance(instanceName, zookeepers).usingToken(user, new
PasswordToken(password)).build();
   }
 
   protected void startTimer() {
@@ -79,7 +77,7 @@ public abstract class ScaleTest {
     return keys;
   }
 
-  public Connector getConnector() {
+  public AccumuloClient getClient() {
     return conn;
   }
 
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/stress/Scan.java b/core/src/main/java/org/apache/accumulo/testing/core/stress/Scan.java
index e9db7d8..65b7a2b 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/stress/Scan.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/stress/Scan.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Random;
 
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
@@ -38,7 +39,7 @@ public class Scan {
     ScanOpts opts = new ScanOpts();
     opts.parseArgs(Scan.class.getName(), args);
 
-    Connector connector = opts.getConnector();
+    AccumuloClient connector = opts.getClient();
     Scanner scanner = connector.createScanner(opts.getTableName(), new Authorizations());
 
     if (opts.isolate) {
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/stress/Write.java b/core/src/main/java/org/apache/accumulo/testing/core/stress/Write.java
index 508f80a..d27afa5 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/stress/Write.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/stress/Write.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.testing.core.stress;
 
 import org.apache.accumulo.core.cli.BatchWriterOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
@@ -30,7 +31,7 @@ public class Write {
 
     opts.check();
 
-    Connector c = opts.getConnector();
+    AccumuloClient c = opts.getClient();
 
     if (opts.clear_table && c.tableOperations().exists(opts.getTableName())) {
       try {
diff --git a/core/src/test/java/org/apache/accumulo/testing/core/randomwalk/ReplicationRandomWalkIT.java
b/core/src/test/java/org/apache/accumulo/testing/core/randomwalk/ReplicationRandomWalkIT.java
index e0b547c..02e7409 100644
--- a/core/src/test/java/org/apache/accumulo/testing/core/randomwalk/ReplicationRandomWalkIT.java
+++ b/core/src/test/java/org/apache/accumulo/testing/core/randomwalk/ReplicationRandomWalkIT.java
@@ -56,7 +56,7 @@ public class ReplicationRandomWalkIT extends ConfigurableMacBase {
 
       @Override
       public Connector getAccumuloConnector() throws AccumuloException, AccumuloSecurityException
{
-        return ReplicationRandomWalkIT.this.getConnector();
+        return Connector.from(ReplicationRandomWalkIT.this.getClient());
       }
 
     };


Mime
View raw message