accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwa...@apache.org
Subject [accumulo] branch master updated: Fixes #747 - Shorten method names in AccumuloClient builder (#752)
Date Wed, 14 Nov 2018 20:44:14 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 6c82741  Fixes #747 - Shorten method names in AccumuloClient builder (#752)
6c82741 is described below

commit 6c827413b41b9fd42528a5d86f580b24026ce239
Author: Mike Walch <mwalch@apache.org>
AuthorDate: Wed Nov 14 15:44:09 2018 -0500

    Fixes #747 - Shorten method names in AccumuloClient builder (#752)
---
 .../org/apache/accumulo/core/cli/ClientOpts.java   |  4 +-
 .../org/apache/accumulo/core/client/Accumulo.java  |  4 +-
 .../accumulo/core/client/AccumuloClient.java       | 82 +++++++++++++++-------
 .../apache/accumulo/core/client/ClientInfo.java    |  5 +-
 .../core/client/impl/AccumuloClientImpl.java       | 60 +++++++++-------
 .../accumulo/core/client/impl/ClientInfoImpl.java  | 20 ++++--
 .../core/client/mapred/AbstractInputFormat.java    |  4 +-
 .../core/client/mapred/AccumuloOutputFormat.java   |  4 +-
 .../core/client/mapreduce/AbstractInputFormat.java |  4 +-
 .../client/mapreduce/AccumuloOutputFormat.java     |  4 +-
 .../mapreduce/lib/impl/ConfiguratorBase.java       |  7 +-
 .../mapreduce/lib/impl/MapReduceClientOpts.java    |  4 +-
 .../apache/accumulo/core/conf/ClientProperty.java  |  4 +-
 .../mapreduce/lib/impl/ConfiguratorBaseTest.java   |  4 +-
 .../hadoop/mapred/AccumuloOutputFormat.java        |  2 +-
 .../hadoop/mapreduce/AccumuloOutputFormat.java     |  2 +-
 .../accumulo/hadoop/mapreduce/InputInfo.java       |  3 +-
 .../accumulo/hadoop/mapreduce/OutputInfo.java      |  3 +-
 .../mapred/AccumuloOutputFormatImpl.java           |  2 +-
 .../mapreduce/AccumuloOutputFormatImpl.java        |  2 +-
 .../hadoopImpl/mapreduce/lib/ConfiguratorBase.java |  7 +-
 .../mapreduce/lib/MapReduceClientOpts.java         |  4 +-
 .../mapreduce/lib/ConfiguratorBaseTest.java        |  4 +-
 .../standalone/StandaloneAccumuloCluster.java      |  3 +-
 .../accumulo/minicluster/MiniAccumuloCluster.java  |  3 +-
 .../minicluster/impl/MiniAccumuloClusterImpl.java  |  5 +-
 .../org/apache/accumulo/server/ServerContext.java  |  2 +-
 .../org/apache/accumulo/tracer/TraceServer.java    |  4 +-
 .../main/java/org/apache/accumulo/shell/Shell.java |  3 +-
 .../org/apache/accumulo/shell/ShellOptionsJC.java  |  6 +-
 .../StandaloneAccumuloClusterConfiguration.java    |  4 +-
 .../apache/accumulo/test/BatchWriterIterator.java  |  4 +-
 .../org/apache/accumulo/test/IMMLGBenchmark.java   |  4 +-
 .../org/apache/accumulo/test/ShellServerIT.java    |  3 +-
 .../accumulo/test/functional/AccumuloClientIT.java | 17 +++--
 .../test/functional/ConfigurableMacBase.java       |  5 +-
 .../accumulo/test/functional/ReadWriteIT.java      |  4 +-
 .../test/mapred/AccumuloOutputFormatIT.java        |  3 +-
 38 files changed, 174 insertions(+), 135 deletions(-)

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 2ac66e1..82b214b 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
@@ -174,14 +174,14 @@ public class ClientOpts extends Help {
 
   public ClientInfo getClientInfo() {
     if (cachedInfo == null) {
-      cachedInfo = Accumulo.newClient().usingProperties(getClientProperties()).info();
+      cachedInfo = Accumulo.newClient().from(getClientProperties()).info();
     }
     return cachedInfo;
   }
 
   public AccumuloClient getClient() throws AccumuloException, AccumuloSecurityException {
     if (cachedAccumuloClient == null) {
-      cachedAccumuloClient = Accumulo.newClient().usingClientInfo(getClientInfo()).build();
+      cachedAccumuloClient = Accumulo.newClient().from(getClientInfo()).build();
     }
     return cachedAccumuloClient;
   }
diff --git a/core/src/main/java/org/apache/accumulo/core/client/Accumulo.java b/core/src/main/java/org/apache/accumulo/core/client/Accumulo.java
index b1bd13c..3db071d 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/Accumulo.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/Accumulo.java
@@ -52,8 +52,8 @@ public final class Accumulo {
    * <pre>
    * <code>
    * try (AccumuloClient client = Accumulo.newClient()
-   *        .forInstance(instanceName, zookeepers)
-   *        .usingPassword(user, password).build())
+   *        .to(instanceName, zookeepers)
+   *        .as(user, password).build())
    * {
    *   // use the client
    * }
diff --git a/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java b/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java
index 5371830..d84a0db 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.core.client;
 
+import java.nio.file.Path;
 import java.util.Properties;
 
 import org.apache.accumulo.core.client.admin.InstanceOperations;
@@ -38,8 +39,8 @@ import org.apache.accumulo.core.security.Authorizations;
  * <pre>
  * <code>
  * try (AccumuloClient client = Accumulo.newClient()
- *        .forInstance(instanceName, zookeepers)
- *        .usingPassword(user, password).build())
+ *        .to(instanceName, zookeepers)
+ *        .as(user, password).build())
  * {
  *   // use the client
  * }
@@ -328,10 +329,12 @@ public interface AccumuloClient extends AutoCloseable {
    * using this client will likely fail after close is called.
    */
   @Override
-  public void close();
+  void close();
 
   /**
    * Builds ClientInfo after all options have been specified
+   *
+   * @since 2.0.0
    */
   interface ClientInfoFactory {
 
@@ -345,6 +348,8 @@ public interface AccumuloClient extends AutoCloseable {
 
   /**
    * Builds AccumuloClient
+   *
+   * @since 2.0.0
    */
   interface AccumuloClientFactory extends ClientInfoFactory {
 
@@ -359,13 +364,17 @@ public interface AccumuloClient extends AutoCloseable {
 
   /**
    * Builder method for setting Accumulo instance and zookeepers
+   *
+   * @since 2.0.0
    */
   interface InstanceArgs {
-    AuthenticationArgs forInstance(String instanceName, String zookeepers);
+    AuthenticationArgs to(CharSequence instanceName, CharSequence zookeepers);
   }
 
   /**
    * Builder methods for creating AccumuloClient using properties
+   *
+   * @since 2.0.0
    */
   interface PropertyOptions extends InstanceArgs {
 
@@ -373,24 +382,36 @@ public interface AccumuloClient extends AutoCloseable {
      * Build using properties file. An example properties file can be found at
      * conf/accumulo-client.properties in the Accumulo tarball distribution.
      *
+     * @param propertiesFilePath
+     *          Path to properties file
+     * @return this builder
+     */
+    AccumuloClientFactory from(String propertiesFilePath);
+
+    /**
+     * Build using properties file. An example properties file can be found at
+     * conf/accumulo-client.properties in the Accumulo tarball distribution.
+     *
      * @param propertiesFile
      *          Path to properties file
      * @return this builder
      */
-    AccumuloClientFactory usingProperties(String propertiesFile);
+    AccumuloClientFactory from(Path propertiesFile);
 
     /**
      * Build using Java properties object. A list of available properties can be found in the
-     * documentation on the project website (http://accumulo.apache.org) under 'Development' -&gt;
-     * 'Client Properties'
+     * documentation at https://accumulo.apache.org/docs/2.x/configuration/client-properties
      *
      * @param properties
      *          Properties object
      * @return this builder
      */
-    AccumuloClientFactory usingProperties(Properties properties);
+    AccumuloClientFactory from(Properties properties);
   }
 
+  /**
+   * @since 2.0.0
+   */
   interface ClientInfoOptions extends PropertyOptions {
 
     /**
@@ -400,11 +421,13 @@ public interface AccumuloClient extends AutoCloseable {
      *          ClientInfo object
      * @return this builder
      */
-    FromOptions usingClientInfo(ClientInfo clientInfo);
+    FromOptions from(ClientInfo clientInfo);
   }
 
   /**
-   * Build methods for authentication
+   * Builder methods for authentication
+   *
+   * @since 2.0.0
    */
   interface AuthenticationArgs {
 
@@ -417,7 +440,7 @@ public interface AccumuloClient extends AutoCloseable {
      *          Password
      * @return this builder
      */
-    ConnectionOptions usingPassword(String username, CharSequence password);
+    ConnectionOptions as(CharSequence username, CharSequence password);
 
     /**
      * Build using Kerberos credentials
@@ -428,7 +451,7 @@ public interface AccumuloClient extends AutoCloseable {
      *          Path to keytab file
      * @return this builder
      */
-    ConnectionOptions usingKerberos(String principal, String keyTabFile);
+    ConnectionOptions as(CharSequence principal, Path keyTabFile);
 
     /**
      * Build using specified credentials
@@ -439,11 +462,13 @@ public interface AccumuloClient extends AutoCloseable {
      *          Authentication token
      * @return this builder
      */
-    ConnectionOptions usingToken(String principal, AuthenticationToken token);
+    ConnectionOptions as(CharSequence principal, AuthenticationToken token);
   }
 
   /**
    * Build methods for SSL/TLS
+   *
+   * @since 2.0.0
    */
   interface SslOptions extends AccumuloClientFactory {
 
@@ -454,7 +479,7 @@ public interface AccumuloClient extends AutoCloseable {
      *          Path to trust store
      * @return this builder
      */
-    SslOptions withTruststore(String path);
+    SslOptions truststore(CharSequence path);
 
     /**
      * Build with SSL trust store
@@ -467,7 +492,7 @@ public interface AccumuloClient extends AutoCloseable {
      *          Trust store type
      * @return this builder
      */
-    SslOptions withTruststore(String path, String password, String type);
+    SslOptions truststore(CharSequence path, CharSequence password, CharSequence type);
 
     /**
      * Build with SSL key store
@@ -476,7 +501,7 @@ public interface AccumuloClient extends AutoCloseable {
      *          Path to SSL key store
      * @return this builder
      */
-    SslOptions withKeystore(String path);
+    SslOptions keystore(CharSequence path);
 
     /**
      * Build with SSL key store
@@ -489,7 +514,7 @@ public interface AccumuloClient extends AutoCloseable {
      *          Key store type
      * @return this builder
      */
-    SslOptions withKeystore(String path, String password, String type);
+    SslOptions keystore(CharSequence path, CharSequence password, CharSequence type);
 
     /**
      * Use JSSE system properties to configure SSL
@@ -501,6 +526,8 @@ public interface AccumuloClient extends AutoCloseable {
 
   /**
    * Build methods for SASL
+   *
+   * @since 2.0.0
    */
   interface SaslOptions extends AccumuloClientFactory {
 
@@ -511,7 +538,7 @@ public interface AccumuloClient extends AutoCloseable {
      *          Kerberos server primary
      * @return this builder
      */
-    SaslOptions withPrimary(String kerberosServerPrimary);
+    SaslOptions primary(CharSequence kerberosServerPrimary);
 
     /**
      * Build with SASL quality of protection
@@ -520,11 +547,13 @@ public interface AccumuloClient extends AutoCloseable {
      *          Quality of protection
      * @return this builder
      */
-    SaslOptions withQop(String qualityOfProtection);
+    SaslOptions qop(CharSequence qualityOfProtection);
   }
 
   /**
    * Build methods for connection options
+   *
+   * @since 2.0.0
    */
   interface ConnectionOptions extends AccumuloClientFactory {
 
@@ -535,21 +564,21 @@ public interface AccumuloClient extends AutoCloseable {
      *          Zookeeper timeout (in milliseconds)
      * @return this builder
      */
-    ConnectionOptions withZkTimeout(int timeout);
+    ConnectionOptions zkTimeout(int timeout);
 
     /**
      * Build with SSL/TLS options
      *
      * @return this builder
      */
-    SslOptions withSsl();
+    SslOptions useSsl();
 
     /**
      * Build with SASL options
      *
      * @return this builder
      */
-    SaslOptions withSasl();
+    SaslOptions useSasl();
 
     /**
      * Build with BatchWriterConfig defaults for BatchWriter, MultiTableBatchWriter &amp;
@@ -559,19 +588,22 @@ public interface AccumuloClient extends AutoCloseable {
      *          BatchWriterConfig
      * @return this builder
      */
-    ConnectionOptions withBatchWriterConfig(BatchWriterConfig batchWriterConfig);
+    ConnectionOptions batchWriterConfig(BatchWriterConfig batchWriterConfig);
 
     /**
      * Build with default number of query threads for BatchScanner
      */
-    ConnectionOptions withBatchScannerQueryThreads(int numQueryThreads);
+    ConnectionOptions batchScannerQueryThreads(int numQueryThreads);
 
     /**
      * Build with default batch size for Scanner
      */
-    ConnectionOptions withScannerBatchSize(int batchSize);
+    ConnectionOptions scannerBatchSize(int batchSize);
   }
 
+  /**
+   * @since 2.0.0
+   */
   interface FromOptions extends ConnectionOptions, PropertyOptions, AuthenticationArgs {
 
   }
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ClientInfo.java b/core/src/main/java/org/apache/accumulo/core/client/ClientInfo.java
index 6eb8809..b55874b 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ClientInfo.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ClientInfo.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.core.client;
 
+import java.nio.file.Path;
 import java.util.Properties;
 
 import org.apache.accumulo.core.client.impl.ClientInfoImpl;
@@ -80,7 +81,7 @@ public interface ClientInfo {
   /**
    * @return ClientInfo given path to client config file
    */
-  static ClientInfo from(String configFile) {
-    return new ClientInfoImpl(configFile);
+  static ClientInfo from(Path propertiesFile) {
+    return new ClientInfoImpl(propertiesFile);
   }
 }
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 1506f26..6839014 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
@@ -18,6 +18,7 @@ package org.apache.accumulo.core.client.impl;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
+import java.nio.file.Path;
 import java.util.Objects;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
@@ -269,7 +270,7 @@ public class AccumuloClientImpl implements AccumuloClient {
   public AccumuloClient changeUser(String principal, AuthenticationToken token)
       throws AccumuloSecurityException, AccumuloException {
     ensureOpen();
-    return Accumulo.newClient().usingClientInfo(info()).usingToken(principal, token).build();
+    return Accumulo.newClient().from(info()).as(principal, token).build();
   }
 
   @Override
@@ -313,20 +314,20 @@ public class AccumuloClientImpl implements AccumuloClient {
     }
 
     @Override
-    public AuthenticationArgs forInstance(String instanceName, String zookeepers) {
+    public AuthenticationArgs to(CharSequence instanceName, CharSequence zookeepers) {
       setProperty(ClientProperty.INSTANCE_NAME, instanceName);
       setProperty(ClientProperty.INSTANCE_ZOOKEEPERS, zookeepers);
       return this;
     }
 
     @Override
-    public SslOptions withTruststore(String path) {
+    public SslOptions truststore(CharSequence path) {
       setProperty(ClientProperty.SSL_TRUSTSTORE_PATH, path);
       return this;
     }
 
     @Override
-    public SslOptions withTruststore(String path, String password, String type) {
+    public SslOptions truststore(CharSequence path, CharSequence password, CharSequence type) {
       setProperty(ClientProperty.SSL_TRUSTSTORE_PATH, path);
       setProperty(ClientProperty.SSL_TRUSTSTORE_PASSWORD, password);
       setProperty(ClientProperty.SSL_TRUSTSTORE_TYPE, type);
@@ -334,13 +335,13 @@ public class AccumuloClientImpl implements AccumuloClient {
     }
 
     @Override
-    public SslOptions withKeystore(String path) {
+    public SslOptions keystore(CharSequence path) {
       setProperty(ClientProperty.SSL_KEYSTORE_PATH, path);
       return this;
     }
 
     @Override
-    public SslOptions withKeystore(String path, String password, String type) {
+    public SslOptions keystore(CharSequence path, CharSequence password, CharSequence type) {
       setProperty(ClientProperty.SSL_KEYSTORE_PATH, path);
       setProperty(ClientProperty.SSL_KEYSTORE_PASSWORD, password);
       setProperty(ClientProperty.SSL_KEYSTORE_TYPE, type);
@@ -354,25 +355,25 @@ public class AccumuloClientImpl implements AccumuloClient {
     }
 
     @Override
-    public ConnectionOptions withZkTimeout(int timeout) {
+    public ConnectionOptions zkTimeout(int timeout) {
       setProperty(ClientProperty.INSTANCE_ZOOKEEPERS_TIMEOUT, Integer.toString(timeout) + "ms");
       return this;
     }
 
     @Override
-    public SslOptions withSsl() {
+    public SslOptions useSsl() {
       setProperty(ClientProperty.SSL_ENABLED, "true");
       return this;
     }
 
     @Override
-    public SaslOptions withSasl() {
+    public SaslOptions useSasl() {
       setProperty(ClientProperty.SASL_ENABLED, "true");
       return this;
     }
 
     @Override
-    public ConnectionOptions withBatchWriterConfig(BatchWriterConfig batchWriterConfig) {
+    public ConnectionOptions batchWriterConfig(BatchWriterConfig batchWriterConfig) {
       setProperty(ClientProperty.BATCH_WRITER_MAX_MEMORY_BYTES, batchWriterConfig.getMaxMemory());
       setProperty(ClientProperty.BATCH_WRITER_MAX_LATENCY_SEC,
           batchWriterConfig.getMaxLatency(TimeUnit.SECONDS));
@@ -386,69 +387,74 @@ public class AccumuloClientImpl implements AccumuloClient {
     }
 
     @Override
-    public ConnectionOptions withBatchScannerQueryThreads(int numQueryThreads) {
+    public ConnectionOptions batchScannerQueryThreads(int numQueryThreads) {
       setProperty(ClientProperty.BATCH_SCANNER_NUM_QUERY_THREADS, numQueryThreads);
       return this;
     }
 
     @Override
-    public ConnectionOptions withScannerBatchSize(int batchSize) {
+    public ConnectionOptions scannerBatchSize(int batchSize) {
       setProperty(ClientProperty.SCANNER_BATCH_SIZE, batchSize);
       return this;
     }
 
     @Override
-    public SaslOptions withPrimary(String kerberosServerPrimary) {
+    public SaslOptions primary(CharSequence kerberosServerPrimary) {
       setProperty(ClientProperty.SASL_KERBEROS_SERVER_PRIMARY, kerberosServerPrimary);
       return this;
     }
 
     @Override
-    public SaslOptions withQop(String qualityOfProtection) {
+    public SaslOptions qop(CharSequence qualityOfProtection) {
       setProperty(ClientProperty.SASL_QOP, qualityOfProtection);
       return this;
     }
 
     @Override
-    public AccumuloClientFactory usingProperties(String configFile) {
-      return usingProperties(ClientInfoImpl.toProperties(configFile));
+    public AccumuloClientFactory from(String propertiesFilePath) {
+      return from(ClientInfoImpl.toProperties(propertiesFilePath));
     }
 
     @Override
-    public AccumuloClientFactory usingProperties(Properties properties) {
+    public AccumuloClientFactory from(Path propertiesFile) {
+      return from(ClientInfoImpl.toProperties(propertiesFile));
+    }
+
+    @Override
+    public AccumuloClientFactory from(Properties properties) {
       this.properties = properties;
       return this;
     }
 
     @Override
-    public ConnectionOptions usingPassword(String principal, CharSequence password) {
-      setProperty(ClientProperty.AUTH_PRINCIPAL, principal);
-      ClientProperty.setPassword(properties, password.toString());
+    public ConnectionOptions as(CharSequence username, CharSequence password) {
+      setProperty(ClientProperty.AUTH_PRINCIPAL, username);
+      ClientProperty.setPassword(properties, password);
       return this;
     }
 
     @Override
-    public ConnectionOptions usingKerberos(String principal, String keyTabFile) {
+    public ConnectionOptions as(CharSequence principal, Path keyTabFile) {
       setProperty(ClientProperty.AUTH_PRINCIPAL, principal);
-      ClientProperty.setKerberosKeytab(properties, keyTabFile);
+      ClientProperty.setKerberosKeytab(properties, keyTabFile.toString());
       return this;
     }
 
     @Override
-    public ConnectionOptions usingToken(String principal, AuthenticationToken token) {
-      setProperty(ClientProperty.AUTH_PRINCIPAL, principal);
+    public ConnectionOptions as(CharSequence principal, AuthenticationToken token) {
+      setProperty(ClientProperty.AUTH_PRINCIPAL, principal.toString());
       this.token = token;
       return this;
     }
 
     @Override
-    public FromOptions usingClientInfo(ClientInfo clientInfo) {
+    public FromOptions from(ClientInfo clientInfo) {
       this.properties = clientInfo.getProperties();
       return this;
     }
 
-    public void setProperty(ClientProperty property, String value) {
-      properties.setProperty(property.getKey(), value);
+    public void setProperty(ClientProperty property, CharSequence value) {
+      properties.setProperty(property.getKey(), value.toString());
     }
 
     public void setProperty(ClientProperty property, Long value) {
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ClientInfoImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ClientInfoImpl.java
index ff4ccca..29e42bb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ClientInfoImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ClientInfoImpl.java
@@ -19,6 +19,8 @@ package org.apache.accumulo.core.client.impl;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.Properties;
 
 import org.apache.accumulo.core.client.ClientInfo;
@@ -33,8 +35,8 @@ public class ClientInfoImpl implements ClientInfo {
   private Properties properties;
   private AuthenticationToken token;
 
-  public ClientInfoImpl(String configFile) {
-    this(ClientInfoImpl.toProperties(configFile));
+  public ClientInfoImpl(Path propertiesFile) {
+    this(ClientInfoImpl.toProperties(propertiesFile));
   }
 
   public ClientInfoImpl(Properties properties) {
@@ -92,13 +94,19 @@ public class ClientInfoImpl implements ClientInfo {
   }
 
   @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN",
-      justification = "code runs in same security context as user who provided configFile")
-  public static Properties toProperties(String configFile) {
+      justification = "code runs in same security context as user who provided propertiesFilePath")
+  public static Properties toProperties(String propertiesFilePath) {
+    return toProperties(Paths.get(propertiesFilePath));
+  }
+
+  @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN",
+      justification = "code runs in same security context as user who provided propertiesFile")
+  public static Properties toProperties(Path propertiesFile) {
     Properties properties = new Properties();
-    try (InputStream is = new FileInputStream(configFile)) {
+    try (InputStream is = new FileInputStream(propertiesFile.toFile())) {
       properties.load(is);
     } catch (IOException e) {
-      throw new IllegalArgumentException("Failed to load properties from " + configFile, e);
+      throw new IllegalArgumentException("Failed to load properties from " + propertiesFile, e);
     }
     return properties;
   }
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
index 138ccd4..09787f5 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
@@ -181,8 +181,8 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
     if (token instanceof KerberosToken) {
       log.info("Received KerberosToken, attempting to fetch DelegationToken");
       try {
-        AccumuloClient client = Accumulo.newClient().usingClientInfo(getClientInfo(job))
-            .usingToken(principal, token).build();
+        AccumuloClient client = Accumulo.newClient().from(getClientInfo(job)).as(principal, token)
+            .build();
         token = client.securityOperations().getDelegationToken(new DelegationTokenConfig());
       } catch (Exception e) {
         log.warn("Failed to automatically obtain DelegationToken, Mappers/Reducers will likely"
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
index dd3c7e8..293a9f2 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
@@ -427,7 +427,7 @@ public class AccumuloOutputFormat implements OutputFormat<Text,Mutation> {
       this.defaultTableName = (tname == null) ? null : new Text(tname);
 
       if (!simulate) {
-        this.client = Accumulo.newClient().usingClientInfo(getClientInfo(job)).build();
+        this.client = Accumulo.newClient().from(getClientInfo(job)).build();
         mtbw = client.createMultiTableBatchWriter(getBatchWriterOptions(job));
       }
     }
@@ -564,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 = Accumulo.newClient().usingClientInfo(getClientInfo(job)).build();
+      AccumuloClient c = Accumulo.newClient().from(getClientInfo(job)).build();
       String principal = getPrincipal(job);
       AuthenticationToken token = getAuthenticationToken(job);
       if (!c.securityOperations().authenticateUser(principal, token))
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
index 2c4b934..1c76e5d 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
@@ -183,8 +183,8 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
     if (token instanceof KerberosToken) {
       log.info("Received KerberosToken, attempting to fetch DelegationToken");
       try {
-        AccumuloClient client = Accumulo.newClient().usingClientInfo(getClientInfo(job))
-            .usingToken(principal, token).build();
+        AccumuloClient client = Accumulo.newClient().from(getClientInfo(job)).as(principal, token)
+            .build();
         token = client.securityOperations().getDelegationToken(new DelegationTokenConfig());
       } catch (Exception e) {
         log.warn("Failed to automatically obtain DelegationToken, "
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
index c07846e..07c437c 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
@@ -430,7 +430,7 @@ public class AccumuloOutputFormat extends OutputFormat<Text,Mutation> {
       this.defaultTableName = (tname == null) ? null : new Text(tname);
 
       if (!simulate) {
-        this.client = Accumulo.newClient().usingClientInfo(getClientInfo(context)).build();
+        this.client = Accumulo.newClient().from(getClientInfo(context)).build();
         mtbw = client.createMultiTableBatchWriter(getBatchWriterOptions(context));
       }
     }
@@ -569,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 = Accumulo.newClient().usingClientInfo(getClientInfo(job)).build();
+      AccumuloClient c = Accumulo.newClient().from(getClientInfo(job)).build();
       if (!c.securityOperations().authenticateUser(principal, token))
         throw new IOException("Unable to authenticate user");
     } catch (AccumuloException | AccumuloSecurityException e) {
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
index 71f2cdc..86fc95d 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
@@ -119,11 +119,10 @@ public class ConfiguratorBase {
     if (info.getAuthenticationToken() instanceof KerberosToken) {
       log.info("Received KerberosToken, attempting to fetch DelegationToken");
       try {
-        AccumuloClient client = Accumulo.newClient().usingClientInfo(info).build();
+        AccumuloClient client = Accumulo.newClient().from(info).build();
         AuthenticationToken token = client.securityOperations()
             .getDelegationToken(new DelegationTokenConfig());
-        result = Accumulo.newClient().usingClientInfo(info).usingToken(info.getPrincipal(), token)
-            .info();
+        result = Accumulo.newClient().from(info).as(info.getPrincipal(), token).info();
       } catch (Exception e) {
         log.warn("Failed to automatically obtain DelegationToken, "
             + "Mappers/Reducers will likely fail to communicate with Accumulo", e);
@@ -353,7 +352,7 @@ public class ConfiguratorBase {
    */
   public static AccumuloClient getClient(Class<?> implementingClass, Configuration conf) {
     try {
-      return Accumulo.newClient().usingClientInfo(getClientInfo(implementingClass, conf)).build();
+      return Accumulo.newClient().from(getClientInfo(implementingClass, conf)).build();
     } catch (AccumuloException | AccumuloSecurityException e) {
       throw new IllegalStateException(e);
     }
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java
index fae11f3..d3d2820 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java
@@ -61,8 +61,8 @@ public class MapReduceClientOpts extends ClientOpts {
         log.info("Obtaining delegation token for {}", newPrincipal);
 
         setPrincipal(newPrincipal);
-        AccumuloClient client = Accumulo.newClient().usingClientInfo(getClientInfo())
-            .usingToken(newPrincipal, krbToken).build();
+        AccumuloClient client = Accumulo.newClient().from(getClientInfo())
+            .as(newPrincipal, krbToken).build();
 
         // Do the explicit check to see if the user has the permission to get a delegation token
         if (!client.securityOperations().hasSystemPermission(client.whoami(),
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/ClientProperty.java b/core/src/main/java/org/apache/accumulo/core/conf/ClientProperty.java
index 911079b..8801507 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/ClientProperty.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/ClientProperty.java
@@ -222,9 +222,9 @@ public enum ClientProperty {
         Base64.getDecoder().decode(tokenString));
   }
 
-  public static void setPassword(Properties properties, String password) {
+  public static void setPassword(Properties properties, CharSequence password) {
     properties.setProperty(ClientProperty.AUTH_TYPE.getKey(), "password");
-    properties.setProperty(ClientProperty.AUTH_TOKEN.getKey(), password);
+    properties.setProperty(ClientProperty.AUTH_TOKEN.getKey(), password.toString());
   }
 
   public static void setKerberosKeytab(Properties properties, String keytabPath) {
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java
index 3c022d7..671526e 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java
@@ -79,8 +79,8 @@ public class ConfiguratorBaseTest {
   @Test
   public void testSetClientInfo() {
     Configuration conf = new Configuration();
-    ClientInfo info = Accumulo.newClient().forInstance("myinstance", "myzookeepers")
-        .usingPassword("user", "pass").info();
+    ClientInfo info = Accumulo.newClient().to("myinstance", "myzookeepers").as("user", "pass")
+        .info();
     ConfiguratorBase.setClientInfo(this.getClass(), conf, info);
     ClientInfo info2 = ConfiguratorBase.getClientInfo(this.getClass(), conf);
     assertEquals("myinstance", info2.getInstanceName());
diff --git a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapred/AccumuloOutputFormat.java b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapred/AccumuloOutputFormat.java
index 9fb903a..dca05a4 100644
--- a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapred/AccumuloOutputFormat.java
+++ b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapred/AccumuloOutputFormat.java
@@ -63,7 +63,7 @@ public class AccumuloOutputFormat implements OutputFormat<Text,Mutation> {
       ClientInfo clientInfo = getClientInfo(job);
       String principal = clientInfo.getPrincipal();
       AuthenticationToken token = clientInfo.getAuthenticationToken();
-      AccumuloClient c = Accumulo.newClient().usingClientInfo(clientInfo).build();
+      AccumuloClient c = Accumulo.newClient().from(clientInfo).build();
       if (!c.securityOperations().authenticateUser(principal, token))
         throw new IOException("Unable to authenticate user");
     } catch (AccumuloException | AccumuloSecurityException e) {
diff --git a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/AccumuloOutputFormat.java b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/AccumuloOutputFormat.java
index 41818ee..a285988 100644
--- a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/AccumuloOutputFormat.java
+++ b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/AccumuloOutputFormat.java
@@ -64,7 +64,7 @@ public class AccumuloOutputFormat extends OutputFormat<Text,Mutation> {
       ClientInfo clientInfo = getClientInfo(job);
       String principal = clientInfo.getPrincipal();
       AuthenticationToken token = clientInfo.getAuthenticationToken();
-      AccumuloClient c = Accumulo.newClient().usingClientInfo(clientInfo).build();
+      AccumuloClient c = Accumulo.newClient().from(clientInfo).build();
 
       if (!c.securityOperations().authenticateUser(principal, token))
         throw new IOException("Unable to authenticate user");
diff --git a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/InputInfo.java b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/InputInfo.java
index a5bdc89..d443ce4 100644
--- a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/InputInfo.java
+++ b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/InputInfo.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.hadoop.mapreduce;
 
+import java.nio.file.Path;
 import java.util.Collection;
 import java.util.Map;
 import java.util.Optional;
@@ -140,7 +141,7 @@ public interface InputInfo {
     interface ClientParams {
       /**
        * Set the connection information needed to communicate with Accumulo in this job. ClientInfo
-       * param can be created using {@link ClientInfo#from(String)} or
+       * param can be created using {@link ClientInfo#from(Path)} or
        * {@link ClientInfo#from(Properties)}
        *
        * @param clientInfo
diff --git a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/OutputInfo.java b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/OutputInfo.java
index 20f9667..0ca7443 100644
--- a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/OutputInfo.java
+++ b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/OutputInfo.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.hadoop.mapreduce;
 
+import java.nio.file.Path;
 import java.util.Optional;
 import java.util.Properties;
 
@@ -83,7 +84,7 @@ public interface OutputInfo {
     interface ClientParams {
       /**
        * Set the connection information needed to communicate with Accumulo in this job. ClientInfo
-       * param can be created using {@link ClientInfo#from(String)} or
+       * param can be created using {@link ClientInfo#from(Path)} or
        * {@link ClientInfo#from(Properties)}
        *
        * @param clientInfo
diff --git a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapred/AccumuloOutputFormatImpl.java b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapred/AccumuloOutputFormatImpl.java
index 7e8f4d8..0f52588 100644
--- a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapred/AccumuloOutputFormatImpl.java
+++ b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapred/AccumuloOutputFormatImpl.java
@@ -248,7 +248,7 @@ public class AccumuloOutputFormatImpl {
       this.defaultTableName = (tname == null) ? null : new Text(tname);
 
       if (!simulate) {
-        this.client = Accumulo.newClient().usingClientInfo(getClientInfo(job)).build();
+        this.client = Accumulo.newClient().from(getClientInfo(job)).build();
         mtbw = client.createMultiTableBatchWriter(getBatchWriterOptions(job));
       }
     }
diff --git a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/AccumuloOutputFormatImpl.java b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/AccumuloOutputFormatImpl.java
index 54a0042..c51efa6 100644
--- a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/AccumuloOutputFormatImpl.java
+++ b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/AccumuloOutputFormatImpl.java
@@ -251,7 +251,7 @@ public class AccumuloOutputFormatImpl {
       this.defaultTableName = (tname == null) ? null : new Text(tname);
 
       if (!simulate) {
-        this.client = Accumulo.newClient().usingClientInfo(getClientInfo(context)).build();
+        this.client = Accumulo.newClient().from(getClientInfo(context)).build();
         mtbw = client.createMultiTableBatchWriter(getBatchWriterOptions(context));
       }
     }
diff --git a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/ConfiguratorBase.java b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/ConfiguratorBase.java
index 3032d27..ea4dc13 100644
--- a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/ConfiguratorBase.java
+++ b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/ConfiguratorBase.java
@@ -118,11 +118,10 @@ public class ConfiguratorBase {
     if (info.getAuthenticationToken() instanceof KerberosToken) {
       log.info("Received KerberosToken, attempting to fetch DelegationToken");
       try {
-        AccumuloClient client = Accumulo.newClient().usingClientInfo(info).build();
+        AccumuloClient client = Accumulo.newClient().from(info).build();
         AuthenticationToken token = client.securityOperations()
             .getDelegationToken(new DelegationTokenConfig());
-        result = Accumulo.newClient().usingClientInfo(info).usingToken(info.getPrincipal(), token)
-            .info();
+        result = Accumulo.newClient().from(info).as(info.getPrincipal(), token).info();
       } catch (Exception e) {
         log.warn("Failed to automatically obtain DelegationToken, "
             + "Mappers/Reducers will likely fail to communicate with Accumulo", e);
@@ -308,7 +307,7 @@ public class ConfiguratorBase {
    */
   public static AccumuloClient getClient(Class<?> implementingClass, Configuration conf) {
     try {
-      return Accumulo.newClient().usingClientInfo(getClientInfo(implementingClass, conf)).build();
+      return Accumulo.newClient().from(getClientInfo(implementingClass, conf)).build();
     } catch (AccumuloException | AccumuloSecurityException e) {
       throw new IllegalStateException(e);
     }
diff --git a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/MapReduceClientOpts.java b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/MapReduceClientOpts.java
index ebf5d5d..bbea6c3 100644
--- a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/MapReduceClientOpts.java
+++ b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/MapReduceClientOpts.java
@@ -56,8 +56,8 @@ public abstract class MapReduceClientOpts extends ClientOpts {
         log.info("Obtaining delegation token for {}", newPrincipal);
 
         setPrincipal(newPrincipal);
-        AccumuloClient client = Accumulo.newClient().usingClientInfo(getClientInfo())
-            .usingToken(newPrincipal, krbToken).build();
+        AccumuloClient client = Accumulo.newClient().from(getClientInfo())
+            .as(newPrincipal, krbToken).build();
 
         // Do the explicit check to see if the user has the permission to get a delegation token
         if (!client.securityOperations().hasSystemPermission(client.whoami(),
diff --git a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/ConfiguratorBaseTest.java b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/ConfiguratorBaseTest.java
index f4fcee4..3dcf05a 100644
--- a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/ConfiguratorBaseTest.java
+++ b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoopImpl/mapreduce/lib/ConfiguratorBaseTest.java
@@ -74,8 +74,8 @@ public class ConfiguratorBaseTest {
   @Test
   public void testSetClientInfo() {
     Configuration conf = new Configuration();
-    ClientInfo info = Accumulo.newClient().forInstance("myinstance", "myzookeepers")
-        .usingPassword("user", "pass").info();
+    ClientInfo info = Accumulo.newClient().to("myinstance", "myzookeepers").as("user", "pass")
+        .info();
     ConfiguratorBase.setClientInfo(this.getClass(), conf, info);
     ClientInfo info2 = ConfiguratorBase.getClientInfo(this.getClass(), conf);
     assertEquals("myinstance", info2.getInstanceName());
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 0733fe0..af5abf2 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
@@ -142,8 +142,7 @@ public class StandaloneAccumuloCluster implements AccumuloCluster {
   @Override
   public AccumuloClient getAccumuloClient(String user, AuthenticationToken token)
       throws AccumuloException, AccumuloSecurityException {
-    return Accumulo.newClient().forInstance(getInstanceName(), getZooKeepers())
-        .usingToken(user, token).build();
+    return Accumulo.newClient().to(getInstanceName(), getZooKeepers()).as(user, token).build();
   }
 
   @Override
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 5660f70..5d70e33 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
@@ -20,7 +20,6 @@ import java.io.File;
 import java.io.IOException;
 import java.util.Set;
 
-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;
@@ -165,6 +164,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 Accumulo.newClient().usingProperties(clientProps.getAbsolutePath()).info();
+    return ClientInfo.from(clientProps.toPath());
   }
 }
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 63d3c49..c1b6043 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
@@ -783,7 +783,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
   @Override
   public AccumuloClient getAccumuloClient(String user, AuthenticationToken token)
       throws AccumuloException, AccumuloSecurityException {
-    return Accumulo.newClient().usingClientInfo(getClientInfo()).usingToken(user, token).build();
+    return Accumulo.newClient().from(getClientInfo()).as(user, token).build();
   }
 
   @SuppressWarnings("deprecation")
@@ -796,8 +796,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
   @Override
   public ClientInfo getClientInfo() {
     if (clientInfo == null) {
-      clientInfo = Accumulo.newClient()
-          .usingProperties(config.getClientPropsFile().getAbsolutePath()).info();
+      clientInfo = ClientInfo.from(config.getClientPropsFile().toPath());
     }
     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 3c7e847..91bf091 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
@@ -246,7 +246,7 @@ public class ServerContext extends ClientContext {
 
   public AccumuloClient getClient(String principal, AuthenticationToken token)
       throws AccumuloSecurityException, AccumuloException {
-    return Accumulo.newClient().usingClientInfo(info).usingToken(principal, token).build();
+    return Accumulo.newClient().from(info).as(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 27ea534..fd4c130 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
@@ -273,8 +273,8 @@ public class TraceServer implements Watcher {
           at = token;
         }
 
-        accumuloClient = Accumulo.newClient().usingClientInfo(context.getClientInfo())
-            .usingToken(principal, at).build();
+        accumuloClient = Accumulo.newClient().from(context.getClientInfo()).as(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 1f9b561..9b8943a 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -341,8 +341,7 @@ public class Shell extends ShellOptions implements KeywordExecutable {
       try {
         DistributedTrace.enable(InetAddress.getLocalHost().getHostName(), "shell", properties);
         this.setTableName("");
-        accumuloClient = Accumulo.newClient().usingClientInfo(info).usingToken(principal, token)
-            .build();
+        accumuloClient = Accumulo.newClient().from(info).as(principal, token).build();
         context = new ClientContext(accumuloClient.info());
       } catch (Exception e) {
         printException(e);
diff --git a/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java b/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java
index cdfc89e..18a69ff 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java
@@ -256,7 +256,7 @@ public class ShellOptionsJC {
     return unrecognizedOptions;
   }
 
-  public String getClientConfigFile() {
+  public String getClientPropertiesFile() {
     if (clientConfigFile == null) {
       List<String> searchPaths = new LinkedList<>();
       searchPaths.add(System.getProperty("user.home") + "/.accumulo/accumulo-client.properties");
@@ -278,8 +278,8 @@ public class ShellOptionsJC {
 
   public Properties getClientProperties() {
     Properties props = new Properties();
-    if (getClientConfigFile() != null) {
-      props = ClientInfoImpl.toProperties(getClientConfigFile());
+    if (getClientPropertiesFile() != null) {
+      props = ClientInfoImpl.toProperties(getClientPropertiesFile());
     }
     for (Map.Entry<String,String> entry : commandLineProperties.entrySet()) {
       props.setProperty(entry.getKey(), entry.getValue());
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 b272862..d228c5f 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
@@ -104,8 +104,8 @@ public class StandaloneAccumuloClusterConfiguration extends AccumuloClusterPrope
 
     this.conf = getConfiguration(type);
     this.clientPropsFile = clientPropsFile;
-    clientInfo = Accumulo.newClient().forInstance(getInstanceName(), getZooKeepers())
-        .usingToken(getAdminPrincipal(), getAdminToken()).info();
+    clientInfo = Accumulo.newClient().to(getInstanceName(), getZooKeepers())
+        .as(getAdminPrincipal(), getAdminToken()).info();
 
     // The user Accumulo is running as
     serverUser = conf.get(ACCUMULO_STANDALONE_SERVER_USER);
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 0ada27e..42118ba 100644
--- a/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java
+++ b/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java
@@ -167,8 +167,8 @@ public class BatchWriterIterator extends WrappingIterator {
 
   private void initBatchWriter() {
     try {
-      accumuloClient = Accumulo.newClient().forInstance(instanceName, zookeeperHost)
-          .usingToken(username, auth).withZkTimeout(zookeeperTimeout).build();
+      accumuloClient = Accumulo.newClient().to(instanceName, zookeeperHost).as(username, auth)
+          .zkTimeout(zookeeperTimeout).build();
     } catch (Exception e) {
       log.error("failed to connect to Accumulo instance " + instanceName, e);
       throw new RuntimeException(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 d249691..4384e21 100644
--- a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
+++ b/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
@@ -51,8 +51,8 @@ import com.google.common.collect.Iterators;
 public class IMMLGBenchmark {
   public static void main(String[] args) throws Exception {
 
-    AccumuloClient client = Accumulo.newClient().forInstance("test16", "localhost")
-        .usingPassword("root", "secret").build();
+    AccumuloClient client = Accumulo.newClient().to("test16", "localhost").as("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 cf08e06..802419b 100644
--- a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
@@ -55,7 +55,6 @@ import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.accumulo.core.Constants;
-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;
@@ -176,7 +175,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
 
     TestShell(String user, String rootPass, String instanceName, String zookeepers, File configFile)
         throws IOException {
-      ClientInfo info = Accumulo.newClient().usingProperties(configFile.getAbsolutePath()).info();
+      ClientInfo info = ClientInfo.from(configFile.toPath());
       // 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 487cdca..e006d7c 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
@@ -81,16 +81,15 @@ public class AccumuloClientIT extends AccumuloClusterHarness {
     final String password = "testpassword";
     c.securityOperations().createLocalUser(user, new PasswordToken(password));
 
-    AccumuloClient client = Accumulo.newClient().forInstance(instanceName, zookeepers)
-        .usingPassword(user, password).withZkTimeout(1234).build();
+    AccumuloClient client = Accumulo.newClient().to(instanceName, zookeepers).as(user, password)
+        .zkTimeout(1234).build();
 
     assertEquals(instanceName, client.info().getInstanceName());
     assertEquals(zookeepers, client.info().getZooKeepers());
     assertEquals(user, client.whoami());
     assertEquals(1234, client.info().getZooKeepersSessionTimeOut());
 
-    ClientInfo info = Accumulo.newClient().forInstance(instanceName, zookeepers)
-        .usingPassword(user, password).info();
+    ClientInfo info = Accumulo.newClient().to(instanceName, zookeepers).as(user, password).info();
     assertEquals(instanceName, info.getInstanceName());
     assertEquals(zookeepers, info.getZooKeepers());
     assertEquals(user, info.getPrincipal());
@@ -103,7 +102,7 @@ public class AccumuloClientIT extends AccumuloClusterHarness {
     props.put(ClientProperty.INSTANCE_ZOOKEEPERS_TIMEOUT.getKey(), "22s");
     ClientProperty.setPassword(props, password);
     client.close();
-    client = Accumulo.newClient().usingProperties(props).build();
+    client = Accumulo.newClient().from(props).build();
 
     assertEquals(instanceName, client.info().getInstanceName());
     assertEquals(zookeepers, client.info().getZooKeepers());
@@ -114,8 +113,8 @@ public class AccumuloClientIT extends AccumuloClusterHarness {
     final String password2 = "testpassword2";
     c.securityOperations().createLocalUser(user2, new PasswordToken(password2));
 
-    AccumuloClient client2 = Accumulo.newClient().usingClientInfo(client.info())
-        .usingToken(user2, new PasswordToken(password2)).build();
+    AccumuloClient client2 = Accumulo.newClient().from(client.info())
+        .as(user2, new PasswordToken(password2)).build();
     assertEquals(instanceName, client2.info().getInstanceName());
     assertEquals(zookeepers, client2.info().getZooKeepers());
     assertEquals(user2, client2.whoami());
@@ -152,7 +151,7 @@ public class AccumuloClientIT extends AccumuloClusterHarness {
     assertEquals(0, SingletonManager.getReservationCount());
     assertEquals(Mode.CLIENT, SingletonManager.getMode());
 
-    try (AccumuloClient c = Accumulo.newClient().usingClientInfo(getClientInfo()).build()) {
+    try (AccumuloClient c = Accumulo.newClient().from(getClientInfo()).build()) {
       assertEquals(1, SingletonManager.getReservationCount());
 
       c.tableOperations().create(tableName);
@@ -171,7 +170,7 @@ public class AccumuloClientIT extends AccumuloClusterHarness {
 
     assertEquals(0, SingletonManager.getReservationCount());
 
-    AccumuloClient c = Accumulo.newClient().usingClientInfo(getClientInfo()).build();
+    AccumuloClient c = Accumulo.newClient().from(getClientInfo()).build();
     assertEquals(1, SingletonManager.getReservationCount());
 
     // ensure client created after everything was closed works
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 98f664d..f62dd2f 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
@@ -201,9 +201,8 @@ public class ConfigurableMacBase extends AccumuloITBase {
   }
 
   protected ClientInfo getClientInfo() {
-    return Accumulo.newClient()
-        .forInstance(getCluster().getInstanceName(), getCluster().getZooKeepers())
-        .usingPassword("root", ROOT_PASSWORD).info();
+    return Accumulo.newClient().to(getCluster().getInstanceName(), getCluster().getZooKeepers())
+        .as("root", ROOT_PASSWORD).info();
   }
 
   protected ServerContext getServerContext() {
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 29418a5..3d00a84 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
@@ -127,8 +127,8 @@ public class ReadWriteIT extends AccumuloClusterHarness {
 
   @Test(expected = RuntimeException.class)
   public void invalidInstanceName() throws Exception {
-    Accumulo.newClient().forInstance("fake_instance_name", cluster.getZooKeepers())
-        .usingToken(getAdminPrincipal(), getAdminToken()).build();
+    Accumulo.newClient().to("fake_instance_name", cluster.getZooKeepers())
+        .as(getAdminPrincipal(), getAdminToken()).build();
   }
 
   @SuppressFBWarnings(value = {"PATH_TRAVERSAL_IN", "URLCONNECTION_SSRF_FD"},
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 e311c4a..91867db 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
@@ -169,8 +169,7 @@ public class AccumuloOutputFormatIT extends ConfigurableMacBase {
 
       job.setInputFormat(AccumuloInputFormat.class);
 
-      ClientInfo info = Accumulo.newClient().forInstance(instanceName, zooKeepers)
-          .usingPassword(user, pass).info();
+      ClientInfo info = Accumulo.newClient().to(instanceName, zooKeepers).as(user, pass).info();
 
       AccumuloInputFormat.setClientInfo(job, info);
       AccumuloInputFormat.setInputTableName(job, table1);


Mime
View raw message