accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmil...@apache.org
Subject [accumulo] 06/09: Replace AccumuloClient.builder() with Accumulo.newClient() #636
Date Thu, 20 Sep 2018 17:48:08 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.git

commit 905f338d8203b927d6420665ab1fbda5ddeb3e86
Author: Mike Miller <mmiller@apache.org>
AuthorDate: Fri Sep 7 11:34:24 2018 -0400

    Replace AccumuloClient.builder() with Accumulo.newClient() #636
---
 .../accumulo/core/client/mapred/AbstractInputFormat.java      |  3 ++-
 .../accumulo/core/client/mapred/AccumuloOutputFormat.java     |  5 +++--
 .../accumulo/core/client/mapreduce/AbstractInputFormat.java   |  3 ++-
 .../accumulo/core/client/mapreduce/AccumuloOutputFormat.java  |  5 +++--
 .../core/client/mapreduce/lib/impl/ConfiguratorBase.java      | 10 +++++-----
 .../core/client/mapreduce/lib/impl/MapReduceClientOpts.java   |  3 ++-
 .../core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java  |  4 ++--
 .../main/java/org/apache/accumulo/core/cli/ClientOpts.java    |  5 +++--
 .../apache/accumulo/core/client/impl/AccumuloClientImpl.java  |  3 ++-
 .../cluster/standalone/StandaloneAccumuloCluster.java         |  5 +++--
 .../org/apache/accumulo/minicluster/MiniAccumuloCluster.java  |  3 ++-
 .../accumulo/minicluster/impl/MiniAccumuloClusterImpl.java    | 11 ++++++-----
 .../main/java/org/apache/accumulo/server/ServerContext.java   |  3 ++-
 .../src/main/java/org/apache/accumulo/tracer/TraceServer.java |  5 +++--
 shell/src/main/java/org/apache/accumulo/shell/Shell.java      |  3 ++-
 .../harness/conf/StandaloneAccumuloClusterConfiguration.java  |  4 ++--
 .../java/org/apache/accumulo/test/BatchWriterIterator.java    |  3 ++-
 .../main/java/org/apache/accumulo/test/IMMLGBenchmark.java    |  3 ++-
 .../src/main/java/org/apache/accumulo/test/ShellServerIT.java |  4 ++--
 .../org/apache/accumulo/test/functional/AccumuloClientIT.java |  9 +++++----
 .../apache/accumulo/test/functional/ConfigurableMacBase.java  |  3 ++-
 .../java/org/apache/accumulo/test/functional/ReadWriteIT.java |  3 ++-
 .../apache/accumulo/test/mapred/AccumuloOutputFormatIT.java   |  3 ++-
 23 files changed, 61 insertions(+), 42 deletions(-)

diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
index 83377b4..fc8e26b 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
@@ -31,6 +31,7 @@ import java.util.Map;
 import java.util.Random;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -180,7 +181,7 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V>
{
     if (token instanceof KerberosToken) {
       log.info("Received KerberosToken, attempting to fetch DelegationToken");
       try {
-        AccumuloClient conn = AccumuloClient.builder().usingClientInfo(getClientInfo(job))
+        AccumuloClient conn = Accumulo.newClient().usingClientInfo(getClientInfo(job))
             .usingToken(principal, token).build();
         token = conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
       } catch (Exception e) {
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
index e58d790..f00206a 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
@@ -22,6 +22,7 @@ import java.util.HashSet;
 import java.util.Map.Entry;
 import java.util.Set;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -426,7 +427,7 @@ public class AccumuloOutputFormat implements OutputFormat<Text,Mutation>
{
       this.defaultTableName = (tname == null) ? null : new Text(tname);
 
       if (!simulate) {
-        this.conn = AccumuloClient.builder().usingClientInfo(getClientInfo(job)).build();
+        this.conn = Accumulo.newClient().usingClientInfo(getClientInfo(job)).build();
         mtbw = conn.createMultiTableBatchWriter(getBatchWriterOptions(job));
       }
     }
@@ -563,7 +564,7 @@ public class AccumuloOutputFormat implements OutputFormat<Text,Mutation>
{
       throw new IOException("Connector info has not been set.");
     try {
       // if the instance isn't configured, it will complain here
-      AccumuloClient c = AccumuloClient.builder().usingClientInfo(getClientInfo(job)).build();
+      AccumuloClient c = Accumulo.newClient().usingClientInfo(getClientInfo(job)).build();
       String principal = getPrincipal(job);
       AuthenticationToken token = getAuthenticationToken(job);
       if (!c.securityOperations().authenticateUser(principal, token))
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
index ae4dede..6b23529 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
@@ -31,6 +31,7 @@ import java.util.Map;
 import java.util.Random;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -182,7 +183,7 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V>
{
     if (token instanceof KerberosToken) {
       log.info("Received KerberosToken, attempting to fetch DelegationToken");
       try {
-        AccumuloClient conn = AccumuloClient.builder().usingClientInfo(getClientInfo(job))
+        AccumuloClient conn = Accumulo.newClient().usingClientInfo(getClientInfo(job))
             .usingToken(principal, token).build();
         token = conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
       } catch (Exception e) {
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
index c91382b..dca538c 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
@@ -22,6 +22,7 @@ import java.util.HashSet;
 import java.util.Map.Entry;
 import java.util.Set;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -429,7 +430,7 @@ public class AccumuloOutputFormat extends OutputFormat<Text,Mutation>
{
       this.defaultTableName = (tname == null) ? null : new Text(tname);
 
       if (!simulate) {
-        this.conn = AccumuloClient.builder().usingClientInfo(getClientInfo(context)).build();
+        this.conn = Accumulo.newClient().usingClientInfo(getClientInfo(context)).build();
         mtbw = conn.createMultiTableBatchWriter(getBatchWriterOptions(context));
       }
     }
@@ -568,7 +569,7 @@ public class AccumuloOutputFormat extends OutputFormat<Text,Mutation>
{
       // if the instance isn't configured, it will complain here
       String principal = getPrincipal(job);
       AuthenticationToken token = getAuthenticationToken(job);
-      AccumuloClient c = AccumuloClient.builder().usingClientInfo(getClientInfo(job)).build();
+      AccumuloClient c = Accumulo.newClient().usingClientInfo(getClientInfo(job)).build();
       if (!c.securityOperations().authenticateUser(principal, token))
         throw new IOException("Unable to authenticate user");
     } catch (AccumuloException | AccumuloSecurityException e) {
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
index df380a6..7dc4283 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
@@ -29,6 +29,7 @@ import java.net.URISyntaxException;
 import java.util.Properties;
 import java.util.Scanner;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
@@ -119,11 +120,11 @@ public class ConfiguratorBase {
     if (info.getAuthenticationToken() instanceof KerberosToken) {
       log.info("Received KerberosToken, attempting to fetch DelegationToken");
       try {
-        AccumuloClient conn = AccumuloClient.builder().usingClientInfo(info).build();
+        AccumuloClient conn = Accumulo.newClient().usingClientInfo(info).build();
         AuthenticationToken token = conn.securityOperations()
             .getDelegationToken(new DelegationTokenConfig());
-        result = AccumuloClient.builder().usingClientInfo(info)
-            .usingToken(info.getPrincipal(), token).info();
+        result = Accumulo.newClient().usingClientInfo(info).usingToken(info.getPrincipal(),
token)
+            .info();
       } catch (Exception e) {
         log.warn("Failed to automatically obtain DelegationToken, "
             + "Mappers/Reducers will likely fail to communicate with Accumulo", e);
@@ -351,8 +352,7 @@ public class ConfiguratorBase {
    */
   public static AccumuloClient getConnector(Class<?> implementingClass, Configuration
conf) {
     try {
-      return AccumuloClient.builder().usingClientInfo(getClientInfo(implementingClass, conf))
-          .build();
+      return Accumulo.newClient().usingClientInfo(getClientInfo(implementingClass, conf)).build();
     } catch (AccumuloException | AccumuloSecurityException e) {
       throw new IllegalStateException(e);
     }
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java
b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java
index 0cb8fae..7380a0a 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.core.client.mapreduce.lib.impl;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.cli.ClientOpts;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -60,7 +61,7 @@ public class MapReduceClientOpts extends ClientOpts {
         log.info("Obtaining delegation token for {}", newPrincipal);
 
         setPrincipal(newPrincipal);
-        AccumuloClient conn = AccumuloClient.builder().usingClientInfo(getClientInfo())
+        AccumuloClient conn = Accumulo.newClient().usingClientInfo(getClientInfo())
             .usingToken(newPrincipal, krbToken).build();
 
         // Do the explicit check to see if the user has the permission to get a delegation
token
diff --git a/client/mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java
b/client/mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java
index f5fa9d3..3d08052 100644
--- a/client/mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java
+++ b/client/mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java
@@ -23,8 +23,8 @@ import static org.junit.Assert.assertTrue;
 
 import java.util.Properties;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.ClientInfo;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
@@ -79,7 +79,7 @@ public class ConfiguratorBaseTest {
   @Test
   public void testSetClientInfo() {
     Configuration conf = new Configuration();
-    ClientInfo info = AccumuloClient.builder().forInstance("myinstance", "myzookeepers")
+    ClientInfo info = Accumulo.newClient().forInstance("myinstance", "myzookeepers")
         .usingPassword("user", "pass").info();
     ConfiguratorBase.setClientInfo(this.getClass(), conf, info);
     ClientInfo info2 = ConfiguratorBase.getClientInfo(this.getClass(), conf);
diff --git a/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java b/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
index 85b39f3..bcd058d 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
@@ -24,6 +24,7 @@ import java.io.InputStream;
 import java.net.URL;
 import java.util.Properties;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
@@ -175,14 +176,14 @@ public class ClientOpts extends Help {
 
   public ClientInfo getClientInfo() {
     if (cachedInfo == null) {
-      cachedInfo = AccumuloClient.builder().usingProperties(getClientProperties()).info();
+      cachedInfo = Accumulo.newClient().usingProperties(getClientProperties()).info();
     }
     return cachedInfo;
   }
 
   public AccumuloClient getConnector() throws AccumuloException, AccumuloSecurityException
{
     if (cachedAccumuloClient == null) {
-      cachedAccumuloClient = AccumuloClient.builder().usingClientInfo(getClientInfo()).build();
+      cachedAccumuloClient = Accumulo.newClient().usingClientInfo(getClientInfo()).build();
     }
     return cachedAccumuloClient;
   }
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/AccumuloClientImpl.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/AccumuloClientImpl.java
index 82ced55..fb308f8 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/AccumuloClientImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/AccumuloClientImpl.java
@@ -266,7 +266,8 @@ public class AccumuloClientImpl extends Connector implements AccumuloClient
{
   @Override
   public AccumuloClient changeUser(String principal, AuthenticationToken token)
       throws AccumuloSecurityException, AccumuloException {
-    return AccumuloClient.builder().usingClientInfo(info()).usingToken(principal, token).build();
+    return new AccumuloClientBuilderImpl().usingClientInfo(info()).usingToken(principal,
token)
+        .build();
   }
 
   public static class AccumuloClientBuilderImpl
diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
index 91baff4..198a773 100644
--- a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
@@ -26,6 +26,7 @@ import java.util.List;
 
 import org.apache.accumulo.cluster.AccumuloCluster;
 import org.apache.accumulo.cluster.ClusterUser;
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -138,14 +139,14 @@ public class StandaloneAccumuloCluster implements AccumuloCluster {
   @Override
   public Connector getConnector(String user, AuthenticationToken token)
       throws AccumuloException, AccumuloSecurityException {
-    return Connector.from(AccumuloClient.builder().forInstance(getInstanceName(), getZooKeepers())
+    return Connector.from(Accumulo.newClient().forInstance(getInstanceName(), getZooKeepers())
         .usingToken(user, token).build());
   }
 
   @Override
   public AccumuloClient getAccumuloClient(String user, AuthenticationToken token)
       throws AccumuloException, AccumuloSecurityException {
-    return AccumuloClient.builder().forInstance(getInstanceName(), getZooKeepers())
+    return Accumulo.newClient().forInstance(getInstanceName(), getZooKeepers())
         .usingToken(user, token).build();
   }
 
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
index b07dab8..b3b4673 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
@@ -20,6 +20,7 @@ import java.io.File;
 import java.io.IOException;
 import java.util.Set;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -162,6 +163,6 @@ public class MiniAccumuloCluster {
   public static ClientInfo getClientInfo(File directory) {
     File clientProps = new File(new File(directory, "conf"), "accumulo-client.properties");
     Preconditions.checkArgument(clientProps.exists());
-    return AccumuloClient.builder().usingProperties(clientProps.getAbsolutePath()).info();
+    return Accumulo.newClient().usingProperties(clientProps.getAbsolutePath()).info();
   }
 }
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
index 4e1210e..a785a09 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
@@ -59,6 +59,7 @@ import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.ClientInfo;
 import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.impl.AccumuloClientImpl;
 import org.apache.accumulo.core.client.impl.ClientContext;
 import org.apache.accumulo.core.client.impl.MasterClient;
 import org.apache.accumulo.core.client.impl.thrift.ThriftNotActiveServiceException;
@@ -775,15 +776,15 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
   @Override
   public Connector getConnector(String user, AuthenticationToken token)
       throws AccumuloException, AccumuloSecurityException {
-    return Connector.from(
-        AccumuloClient.builder().usingClientInfo(getClientInfo()).usingToken(user, token).build());
+    return Connector.from(new AccumuloClientImpl.AccumuloClientBuilderImpl()
+        .usingClientInfo(getClientInfo()).usingToken(user, token).build());
   }
 
   @Override
   public AccumuloClient getAccumuloClient(String user, AuthenticationToken token)
       throws AccumuloException, AccumuloSecurityException {
-    return AccumuloClient.builder().usingClientInfo(getClientInfo()).usingToken(user, token)
-        .build();
+    return new AccumuloClientImpl.AccumuloClientBuilderImpl().usingClientInfo(getClientInfo())
+        .usingToken(user, token).build();
   }
 
   @SuppressWarnings("deprecation")
@@ -796,7 +797,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
   @Override
   public ClientInfo getClientInfo() {
     if (clientInfo == null) {
-      clientInfo = AccumuloClient.builder()
+      clientInfo = new AccumuloClientImpl.AccumuloClientBuilderImpl()
           .usingProperties(config.getClientPropsFile().getAbsolutePath()).info();
     }
     return clientInfo;
diff --git a/server/base/src/main/java/org/apache/accumulo/server/ServerContext.java b/server/base/src/main/java/org/apache/accumulo/server/ServerContext.java
index 8c54a59..9bdaa85 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/ServerContext.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/ServerContext.java
@@ -248,7 +248,8 @@ public class ServerContext extends ClientContext {
 
   public AccumuloClient getConnector(String principal, AuthenticationToken token)
       throws AccumuloSecurityException, AccumuloException {
-    return AccumuloClient.builder().usingClientInfo(info).usingToken(principal, token).build();
+    return new AccumuloClientImpl.AccumuloClientBuilderImpl().usingClientInfo(info)
+        .usingToken(principal, token).build();
   }
 
   public synchronized TableManager getTableManager() {
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
index c0e4a26..48607db 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
@@ -39,6 +39,7 @@ import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.MutationsRejectedException;
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.client.impl.AccumuloClientImpl;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken.Properties;
 import org.apache.accumulo.core.client.security.tokens.KerberosToken;
@@ -272,8 +273,8 @@ public class TraceServer implements Watcher {
           at = token;
         }
 
-        accumuloClient = AccumuloClient.builder().usingClientInfo(context.getClientInfo())
-            .usingToken(principal, at).build();
+        accumuloClient = new AccumuloClientImpl.AccumuloClientBuilderImpl()
+            .usingClientInfo(context.getClientInfo()).usingToken(principal, at).build();
         if (!accumuloClient.tableOperations().exists(tableName)) {
           accumuloClient.tableOperations().create(tableName);
           IteratorSetting setting = new IteratorSetting(10, "ageoff", AgeOffFilter.class.getName());
diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
index ba35e0e..5e7b820 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -43,6 +43,7 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
@@ -339,7 +340,7 @@ public class Shell extends ShellOptions implements KeywordExecutable {
       try {
         DistributedTrace.enable(InetAddress.getLocalHost().getHostName(), "shell", properties);
         this.setTableName("");
-        accumuloClient = AccumuloClient.builder().usingClientInfo(info).usingToken(principal,
token)
+        accumuloClient = Accumulo.newClient().usingClientInfo(info).usingToken(principal,
token)
             .build();
         context = new ClientContext(accumuloClient.info());
       } catch (Exception e) {
diff --git a/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
b/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
index d30b96b..9f76756 100644
--- a/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
+++ b/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
@@ -27,7 +27,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 
 import org.apache.accumulo.cluster.ClusterUser;
-import org.apache.accumulo.core.client.AccumuloClient;
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.ClientInfo;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.client.security.tokens.KerberosToken;
@@ -101,7 +101,7 @@ public class StandaloneAccumuloClusterConfiguration extends AccumuloClusterPrope
 
     this.conf = getConfiguration(type);
     this.clientPropsFile = clientPropsFile;
-    clientInfo = AccumuloClient.builder().forInstance(getInstanceName(), getZooKeepers())
+    clientInfo = Accumulo.newClient().forInstance(getInstanceName(), getZooKeepers())
         .usingToken(getAdminPrincipal(), getAdminToken()).info();
 
     // The user Accumulo is running as
diff --git a/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java b/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java
index efc2853..cd1a466 100644
--- a/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java
+++ b/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java
@@ -24,6 +24,7 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -166,7 +167,7 @@ public class BatchWriterIterator extends WrappingIterator {
 
   private void initBatchWriter() {
     try {
-      accumuloClient = AccumuloClient.builder().forInstance(instanceName, zookeeperHost)
+      accumuloClient = Accumulo.newClient().forInstance(instanceName, zookeeperHost)
           .usingToken(username, auth).withZkTimeout(zookeeperTimeout).build();
     } catch (Exception e) {
       log.error("failed to connect to Accumulo instance " + instanceName, e);
diff --git a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java b/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
index 1677744..c27b502 100644
--- a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
+++ b/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
@@ -30,6 +30,7 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -50,7 +51,7 @@ import com.google.common.collect.Iterators;
 public class IMMLGBenchmark {
   public static void main(String[] args) throws Exception {
 
-    AccumuloClient conn = AccumuloClient.builder().forInstance("test16", "localhost")
+    AccumuloClient conn = Accumulo.newClient().forInstance("test16", "localhost")
         .usingPassword("root", "secret").build();
 
     int numlg = Integer.parseInt(args[0]);
diff --git a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
index 4bbe0ef..b7dbc96 100644
--- a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
@@ -54,6 +54,7 @@ import java.util.TreeSet;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -174,8 +175,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
 
     TestShell(String user, String rootPass, String instanceName, String zookeepers, File
configFile)
         throws IOException {
-      ClientInfo info = AccumuloClient.builder().usingProperties(configFile.getAbsolutePath())
-          .info();
+      ClientInfo info = Accumulo.newClient().usingProperties(configFile.getAbsolutePath()).info();
       // start the shell
       output = new TestOutputStream();
       input = new StringInputStream();
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/AccumuloClientIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/AccumuloClientIT.java
index cbaeaf7..70d7c57 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/AccumuloClientIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/AccumuloClientIT.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.test.functional;
 
 import java.util.Properties;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.ClientInfo;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
@@ -37,7 +38,7 @@ public class AccumuloClientIT extends AccumuloClusterHarness {
     final String password = "testpassword";
     c.securityOperations().createLocalUser(user, new PasswordToken(password));
 
-    AccumuloClient conn = AccumuloClient.builder().forInstance(instanceName, zookeepers)
+    AccumuloClient conn = Accumulo.newClient().forInstance(instanceName, zookeepers)
         .usingPassword(user, password).withZkTimeout(1234).build();
 
     Assert.assertEquals(instanceName, conn.info().getInstanceName());
@@ -45,7 +46,7 @@ public class AccumuloClientIT extends AccumuloClusterHarness {
     Assert.assertEquals(user, conn.whoami());
     Assert.assertEquals(1234, conn.info().getZooKeepersSessionTimeOut());
 
-    ClientInfo info = AccumuloClient.builder().forInstance(instanceName, zookeepers)
+    ClientInfo info = Accumulo.newClient().forInstance(instanceName, zookeepers)
         .usingPassword(user, password).info();
     Assert.assertEquals(instanceName, info.getInstanceName());
     Assert.assertEquals(zookeepers, info.getZooKeepers());
@@ -58,7 +59,7 @@ public class AccumuloClientIT extends AccumuloClusterHarness {
     props.put(ClientProperty.AUTH_PRINCIPAL.getKey(), user);
     props.put(ClientProperty.INSTANCE_ZOOKEEPERS_TIMEOUT.getKey(), "22s");
     ClientProperty.setPassword(props, password);
-    conn = AccumuloClient.builder().usingProperties(props).build();
+    conn = Accumulo.newClient().usingProperties(props).build();
 
     Assert.assertEquals(instanceName, conn.info().getInstanceName());
     Assert.assertEquals(zookeepers, conn.info().getZooKeepers());
@@ -69,7 +70,7 @@ public class AccumuloClientIT extends AccumuloClusterHarness {
     final String password2 = "testpassword2";
     c.securityOperations().createLocalUser(user2, new PasswordToken(password2));
 
-    AccumuloClient conn2 = AccumuloClient.builder().usingClientInfo(conn.info())
+    AccumuloClient conn2 = Accumulo.newClient().usingClientInfo(conn.info())
         .usingToken(user2, new PasswordToken(password2)).build();
     Assert.assertEquals(instanceName, conn2.info().getInstanceName());
     Assert.assertEquals(zookeepers, conn2.info().getZooKeepers());
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java
b/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java
index 7832a0b..c6c2292 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.util.Map;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -196,7 +197,7 @@ public class ConfigurableMacBase extends AccumuloITBase {
   }
 
   protected ClientInfo getClientInfo() {
-    return AccumuloClient.builder()
+    return Accumulo.newClient()
         .forInstance(getCluster().getInstanceName(), getCluster().getZooKeepers())
         .usingPassword("root", ROOT_PASSWORD).info();
   }
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java
index b602d17..e164c12 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java
@@ -55,6 +55,7 @@ import javax.net.ssl.X509TrustManager;
 
 import org.apache.accumulo.cluster.ClusterControl;
 import org.apache.accumulo.cluster.standalone.StandaloneAccumuloCluster;
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.cli.ScannerOpts;
@@ -124,7 +125,7 @@ public class ReadWriteIT extends AccumuloClusterHarness {
 
   @Test(expected = RuntimeException.class)
   public void invalidInstanceName() throws Exception {
-    AccumuloClient.builder().forInstance("fake_instance_name", cluster.getZooKeepers())
+    Accumulo.newClient().forInstance("fake_instance_name", cluster.getZooKeepers())
         .usingToken(getAdminPrincipal(), getAdminToken()).build();
   }
 
diff --git a/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloOutputFormatIT.java
b/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloOutputFormatIT.java
index aabeae1..6a12b45 100644
--- a/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloOutputFormatIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloOutputFormatIT.java
@@ -29,6 +29,7 @@ import java.util.Iterator;
 import java.util.Map.Entry;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.accumulo.core.Accumulo;
 import org.apache.accumulo.core.client.AccumuloClient;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -167,7 +168,7 @@ public class AccumuloOutputFormatIT extends ConfigurableMacBase {
 
       job.setInputFormat(AccumuloInputFormat.class);
 
-      ClientInfo info = AccumuloClient.builder().forInstance(instanceName, zooKeepers)
+      ClientInfo info = Accumulo.newClient().forInstance(instanceName, zooKeepers)
           .usingPassword(user, pass).info();
 
       AccumuloInputFormat.setClientInfo(job, info);


Mime
View raw message