accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject accumulo git commit: ACCUMULO-3483 Mark members as private when other methods exists for use.
Date Thu, 15 Jan 2015 19:44:01 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master e085430a1 -> 7606aacf5


ACCUMULO-3483 Mark members as private when other methods exists for use.

ClientOpts has a couple of members which aren't really initialized
until some extra state is processed (e.g. pulling principal from
active kerberos login).


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

Branch: refs/heads/master
Commit: 7606aacf5e4f82b5db3699b8216e60fa4e1b4951
Parents: e085430
Author: Josh Elser <elserj@apache.org>
Authored: Thu Jan 15 14:38:11 2015 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Jan 15 14:38:11 2015 -0500

----------------------------------------------------------------------
 .../apache/accumulo/core/cli/ClientOpts.java    | 32 +++++++++++++++++---
 .../core/cli/MapReduceClientOnDefaultTable.java |  4 +--
 .../cli/MapReduceClientOnRequiredTable.java     |  8 ++---
 .../accumulo/core/cli/TestClientOpts.java       | 18 ++++++++---
 .../simple/client/ReadWriteExample.java         |  4 +--
 .../examples/simple/dirlist/Viewer.java         |  3 +-
 .../examples/simple/dirlist/CountTest.java      |  4 +--
 .../server/cli/ClientOnDefaultTable.java        |  2 +-
 .../server/cli/ClientOnRequiredTable.java       |  2 +-
 .../apache/accumulo/server/cli/ClientOpts.java  |  2 +-
 .../org/apache/accumulo/server/util/Admin.java  |  2 +-
 .../accumulo/server/util/RandomWriter.java      |  5 ++-
 .../util/RemoveEntriesForMissingFiles.java      |  2 +-
 .../server/util/VerifyTabletAssignments.java    |  2 +-
 .../org/apache/accumulo/test/TestIngest.java    |  2 +-
 .../org/apache/accumulo/test/VerifyIngest.java  |  2 +-
 .../apache/accumulo/test/WrongTabletTest.java   |  7 ++++-
 .../continuous/ContinuousStatsCollector.java    |  2 +-
 .../metadata/MetadataBatchScanTest.java         |  2 +-
 .../performance/scan/CollectTabletStats.java    |  2 +-
 .../functional/BulkSplitOptimizationIT.java     |  2 +-
 21 files changed, 75 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
----------------------------------------------------------------------
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 f1a0393..216f32d 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
@@ -106,16 +106,16 @@ public class ClientOpts extends Help {
   }
 
   @Parameter(names = {"-u", "--user"}, description = "Connection user")
-  public String principal = null;
+  private String principal = null;
 
   @Parameter(names = "-p", converter = PasswordConverter.class, description = "Connection
password")
-  public Password password = null;
+  private Password password = null;
 
   @Parameter(names = "--password", converter = PasswordConverter.class, description = "Enter
the connection password", password = true)
-  public Password securePassword = null;
+  private Password securePassword = null;
 
   @Parameter(names = {"-tc", "--tokenClass"}, description = "Token class")
-  public String tokenClassName = null;
+  private String tokenClassName = null;
 
   @DynamicParameter(names = "-l",
       description = "login properties in the format key=value. Reuse -l for each property
(prompt for properties if this option is missing")
@@ -251,6 +251,30 @@ public class ClientOpts extends Help {
     return principal;
   }
 
+  public void setPrincipal(String principal) {
+    this.principal = principal;
+  }
+
+  public Password getPassword() {
+    return password;
+  }
+
+  public void setPassword(Password password) {
+    this.password = password;
+  }
+
+  public Password getSecurePassword() {
+    return securePassword;
+  }
+
+  public void setSecurePassword(Password securePassword) {
+    this.securePassword = securePassword;
+  }
+
+  public String getTokenClassName() {
+    return tokenClassName;
+  }
+
   public Connector getConnector() throws AccumuloException, AccumuloSecurityException {
     return getInstance().getConnector(getPrincipal(), getToken());
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/core/src/main/java/org/apache/accumulo/core/cli/MapReduceClientOnDefaultTable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/cli/MapReduceClientOnDefaultTable.java
b/core/src/main/java/org/apache/accumulo/core/cli/MapReduceClientOnDefaultTable.java
index e7a3dd4..0cf081f 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/MapReduceClientOnDefaultTable.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/MapReduceClientOnDefaultTable.java
@@ -38,10 +38,10 @@ public class MapReduceClientOnDefaultTable extends MapReduceClientOpts
{
   @Override
   public void setAccumuloConfigs(Job job) throws AccumuloSecurityException {
     super.setAccumuloConfigs(job);
-    AccumuloInputFormat.setConnectorInfo(job, principal, getToken());
+    AccumuloInputFormat.setConnectorInfo(job, getPrincipal(), getToken());
     AccumuloInputFormat.setInputTableName(job, getTableName());
     AccumuloInputFormat.setScanAuthorizations(job, auths);
-    AccumuloOutputFormat.setConnectorInfo(job, principal, getToken());
+    AccumuloOutputFormat.setConnectorInfo(job, getPrincipal(), getToken());
     AccumuloOutputFormat.setCreateTables(job, true);
     AccumuloOutputFormat.setDefaultTableName(job, getTableName());
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/core/src/main/java/org/apache/accumulo/core/cli/MapReduceClientOnRequiredTable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/cli/MapReduceClientOnRequiredTable.java
b/core/src/main/java/org/apache/accumulo/core/cli/MapReduceClientOnRequiredTable.java
index abfc17d..7719e92 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/MapReduceClientOnRequiredTable.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/MapReduceClientOnRequiredTable.java
@@ -35,11 +35,11 @@ public class MapReduceClientOnRequiredTable extends MapReduceClientOpts
{
     super.setAccumuloConfigs(job);
 
     if (tokenFile.isEmpty()) {
-      AccumuloInputFormat.setConnectorInfo(job, principal, getToken());
-      AccumuloOutputFormat.setConnectorInfo(job, principal, getToken());
+      AccumuloInputFormat.setConnectorInfo(job, getPrincipal(), getToken());
+      AccumuloOutputFormat.setConnectorInfo(job, getPrincipal(), getToken());
     } else {
-      AccumuloInputFormat.setConnectorInfo(job, principal, tokenFile);
-      AccumuloOutputFormat.setConnectorInfo(job, principal, tokenFile);
+      AccumuloInputFormat.setConnectorInfo(job, getPrincipal(), tokenFile);
+      AccumuloOutputFormat.setConnectorInfo(job, getPrincipal(), tokenFile);
     }
     AccumuloInputFormat.setInputTableName(job, getTableName());
     AccumuloInputFormat.setScanAuthorizations(job, auths);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java b/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
index 435ae85..dc0d53a 100644
--- a/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
+++ b/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.DataInput;
 import java.io.DataOutput;
@@ -32,6 +33,7 @@ import java.util.concurrent.TimeUnit;
 
 import javax.security.auth.DestroyFailedException;
 
+import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.ClientConfiguration;
 import org.apache.accumulo.core.client.ClientConfiguration.ClientProperty;
@@ -63,8 +65,14 @@ public class TestClientOpts {
     ClientOpts args = new ClientOpts();
     BatchWriterOpts bwOpts = new BatchWriterOpts();
     BatchScannerOpts bsOpts = new BatchScannerOpts();
-    assertNull(args.principal);
-    assertNull(args.securePassword);
+    try {
+      assertNull(args.getPrincipal());
+      fail("Expected to receive exception fetching non-existent principal");
+    } catch (AccumuloSecurityException e) {
+      // Pass -- no explicit principal and no token to infer a principal from
+    }
+
+    assertNull(args.getSecurePassword());
     assertNull(args.getToken());
     assertEquals(Long.valueOf(cfg.getMaxLatency(TimeUnit.MILLISECONDS)), bwOpts.batchLatency);
     assertEquals(Long.valueOf(cfg.getTimeout(TimeUnit.MILLISECONDS)), bwOpts.batchTimeout);
@@ -83,8 +91,8 @@ public class TestClientOpts {
     jc.addObject(bsOpts);
     jc.parse("-u", "bar", "-p", "foo", "--batchLatency", "3s", "--batchTimeout", "2s", "--batchMemory",
"1M", "--debug", "--trace", "--scanThreads", "7", "-i",
         "instance", "--auths", "G1,G2,G3", "-z", "zoohost1,zoohost2", "--help");
-    assertEquals("bar", args.principal);
-    assertNull(args.securePassword);
+    assertEquals("bar", args.getPrincipal());
+    assertNull(args.getSecurePassword());
     assertEquals(new PasswordToken("foo"), args.getToken());
     assertEquals(Long.valueOf(3000), bwOpts.batchLatency);
     assertEquals(Long.valueOf(2000), bwOpts.batchTimeout);
@@ -182,7 +190,7 @@ public class TestClientOpts {
     jc.parse("--config-file", clientConfFile.getCanonicalPath());
     args.updateKerberosCredentials();
 
-    assertEquals(KerberosToken.CLASS_NAME, args.tokenClassName);
+    assertEquals(KerberosToken.CLASS_NAME, args.getTokenClassName());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/ReadWriteExample.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/ReadWriteExample.java
b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/ReadWriteExample.java
index b270a6f..70effb1 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/ReadWriteExample.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/ReadWriteExample.java
@@ -80,11 +80,11 @@ public class ReadWriteExample {
     conn = opts.getConnector();
 
     // add the authorizations to the user
-    Authorizations userAuthorizations = conn.securityOperations().getUserAuthorizations(opts.principal);
+    Authorizations userAuthorizations = conn.securityOperations().getUserAuthorizations(opts.getPrincipal());
     ByteArraySet auths = new ByteArraySet(userAuthorizations.getAuthorizations());
     auths.addAll(opts.auths.getAuthorizations());
     if (!auths.isEmpty())
-      conn.securityOperations().changeUserAuthorizations(opts.principal, new Authorizations(auths));
+      conn.securityOperations().changeUserAuthorizations(opts.getPrincipal(), new Authorizations(auths));
 
     // create table
     if (opts.createtable) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Viewer.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Viewer.java
b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Viewer.java
index 70d989f..03c8252 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Viewer.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Viewer.java
@@ -82,6 +82,7 @@ public class Viewer extends JFrame implements TreeSelectionListener, TreeExpansi
       return data;
     }
 
+    @Override
     public String toString() {
       return getName();
     }
@@ -102,7 +103,7 @@ public class Viewer extends JFrame implements TreeSelectionListener, TreeExpansi
     setSize(1000, 800);
     setDefaultCloseOperation(EXIT_ON_CLOSE);
     q = new QueryUtil(opts);
-    fdq = new FileDataQuery(opts.instance, opts.zookeepers, opts.principal, opts.getToken(),
opts.dataTable, opts.auths);
+    fdq = new FileDataQuery(opts.instance, opts.zookeepers, opts.getPrincipal(), opts.getToken(),
opts.dataTable, opts.auths);
     this.topPath = opts.path;
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
index 72ff442..a8aabeb 100644
--- a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
+++ b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
@@ -75,9 +75,9 @@ public class CountTest extends TestCase {
     BatchWriterOpts bwOpts = new BatchWriterOpts();
     opts.instance = "counttest";
     opts.setTableName("dirlisttable");
-    opts.password = new Password("secret");
+    opts.setPassword(new Password("secret"));
     opts.mock = true;
-    opts.password = new Opts.Password("");
+    opts.setPassword(new Opts.Password(""));
     FileCount fc = new FileCount(opts, scanOpts, bwOpts);
     fc.run();
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOnDefaultTable.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOnDefaultTable.java
b/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOnDefaultTable.java
index c347994..10cab49 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOnDefaultTable.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOnDefaultTable.java
@@ -23,7 +23,7 @@ import org.apache.accumulo.server.client.HdfsZooInstance;
 
 public class ClientOnDefaultTable extends org.apache.accumulo.core.cli.ClientOnDefaultTable
{
   {
-    principal = "root";
+    setPrincipal("root");
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOnRequiredTable.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOnRequiredTable.java
b/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOnRequiredTable.java
index 38926be..e134235 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOnRequiredTable.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOnRequiredTable.java
@@ -23,7 +23,7 @@ import org.apache.accumulo.server.client.HdfsZooInstance;
 
 public class ClientOnRequiredTable extends org.apache.accumulo.core.cli.ClientOnRequiredTable
{
   {
-    principal = "root";
+    setPrincipal("root");
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOpts.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOpts.java b/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOpts.java
index 0a7714d..c50d95d 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOpts.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/cli/ClientOpts.java
@@ -24,7 +24,7 @@ import org.apache.accumulo.server.client.HdfsZooInstance;
 public class ClientOpts extends org.apache.accumulo.core.cli.ClientOpts {
 
   {
-    principal = "root";
+    setPrincipal("root");
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java b/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
index 8407c15..77d5ea1 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
@@ -191,7 +191,7 @@ public class Admin {
       if (opts.getToken() == null) {
         context = new AccumuloServerContext(confFactory);
       } else {
-        final Credentials userCreds = new Credentials(opts.principal, opts.getToken());
+        final Credentials userCreds = new Credentials(opts.getPrincipal(), opts.getToken());
         context = new AccumuloServerContext(confFactory) {
           @Override
           public synchronized Credentials getCredentials() {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java b/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java
index b3c198e..dcdabbd 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java
@@ -47,10 +47,12 @@ public class RandomWriter {
       max_mutations = num_mutations;
     }
 
+    @Override
     public boolean hasNext() {
       return mutations_so_far < max_mutations;
     }
 
+    @Override
     public Mutation next() {
       Text row_value = new Text(Long.toString(((r.nextLong() & 0x7fffffffffffffffl) /
177) % 100000000000l));
       Mutation m = new Mutation(row_value);
@@ -67,6 +69,7 @@ public class RandomWriter {
       return m;
     }
 
+    @Override
     public void remove() {
       mutations_so_far++;
     }
@@ -92,7 +95,7 @@ public class RandomWriter {
     opts.parseArgs(RandomWriter.class.getName(), args, bwOpts);
 
     long start = System.currentTimeMillis();
-    log.info("starting at " + start + " for user " + opts.principal);
+    log.info("starting at " + start + " for user " + opts.getPrincipal());
     try {
       Connector connector = opts.getConnector();
       BatchWriter bw = connector.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/server/base/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
b/server/base/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
index b5cf510..0a2cbe9 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
@@ -210,6 +210,6 @@ public class RemoveEntriesForMissingFiles {
     BatchWriterOpts bwOpts = new BatchWriterOpts();
     opts.parseArgs(RemoveEntriesForMissingFiles.class.getName(), args, scanOpts, bwOpts);
 
-    checkAllTables(new ClientContext(opts.getInstance(), new Credentials(opts.principal,
opts.getToken()), ClientConfiguration.loadDefault()), opts.fix);
+    checkAllTables(new ClientContext(opts.getInstance(), new Credentials(opts.getPrincipal(),
opts.getToken()), ClientConfiguration.loadDefault()), opts.fix);
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
b/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
index 98de6be..24746bd 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
@@ -71,7 +71,7 @@ public class VerifyTabletAssignments {
     Opts opts = new Opts();
     opts.parseArgs(VerifyTabletAssignments.class.getName(), args);
 
-    ClientContext context = new ClientContext(opts.getInstance(), new Credentials(opts.principal,
opts.getToken()), opts.getClientConfiguration());
+    ClientContext context = new ClientContext(opts.getInstance(), new Credentials(opts.getPrincipal(),
opts.getToken()), opts.getClientConfiguration());
     Connector conn = opts.getConnector();
     for (String table : conn.tableOperations().list())
       checkTable(context, opts, table, null);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/test/src/main/java/org/apache/accumulo/test/TestIngest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/TestIngest.java b/test/src/main/java/org/apache/accumulo/test/TestIngest.java
index 76bedf2..8c67017 100644
--- a/test/src/main/java/org/apache/accumulo/test/TestIngest.java
+++ b/test/src/main/java/org/apache/accumulo/test/TestIngest.java
@@ -223,7 +223,7 @@ public class TestIngest {
       writer.startDefaultLocalityGroup();
     } else {
       bw = connector.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());
-      connector.securityOperations().changeUserAuthorizations(opts.principal, AUTHS);
+      connector.securityOperations().changeUserAuthorizations(opts.getPrincipal(), AUTHS);
     }
     Text labBA = new Text(opts.columnVisibility.getExpression());
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java b/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java
index 8717c26..503ff1f 100644
--- a/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java
+++ b/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java
@@ -81,7 +81,7 @@ public class VerifyIngest {
     byte[][] bytevals = TestIngest.generateValues(opts.dataSize);
 
     Authorizations labelAuths = new Authorizations("L1", "L2", "G1", "GROUP2");
-    connector.securityOperations().changeUserAuthorizations(opts.principal, labelAuths);
+    connector.securityOperations().changeUserAuthorizations(opts.getPrincipal(), labelAuths);
 
     int expectedRow = opts.startRow;
     int expectedCol = 0;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/test/src/main/java/org/apache/accumulo/test/WrongTabletTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/WrongTabletTest.java b/test/src/main/java/org/apache/accumulo/test/WrongTabletTest.java
index 31e7b06..0cbc871 100644
--- a/test/src/main/java/org/apache/accumulo/test/WrongTabletTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/WrongTabletTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.test;
 
+import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.client.impl.ClientContext;
 import org.apache.accumulo.core.data.KeyExtent;
@@ -50,7 +51,11 @@ public class WrongTabletTest {
     final ClientContext context = new AccumuloServerContext(conf) {
       @Override
       public synchronized Credentials getCredentials() {
-        return new Credentials(opts.principal, opts.getToken());
+        try {
+          return new Credentials(opts.getPrincipal(), opts.getToken());
+        } catch (AccumuloSecurityException e) {
+          throw new RuntimeException(e);
+        }
       }
     };
     try {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousStatsCollector.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousStatsCollector.java
b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousStatsCollector.java
index 7c2f93b..a332b25 100644
--- a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousStatsCollector.java
+++ b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousStatsCollector.java
@@ -137,7 +137,7 @@ public class ContinuousStatsCollector {
 
       MasterClientService.Iface client = null;
       try {
-        ClientContext context = new ClientContext(opts.getInstance(), new Credentials(opts.principal,
opts.getToken()), new ServerConfigurationFactory(
+        ClientContext context = new ClientContext(opts.getInstance(), new Credentials(opts.getPrincipal(),
opts.getToken()), new ServerConfigurationFactory(
             opts.getInstance()).getConfiguration());
         client = MasterClient.getConnectionWithRetry(context);
         MasterMonitorInfo stats = client.getMasterStats(Tracer.traceInfo(), context.rpcCreds());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
b/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
index 979a6b0..6b43f49 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
@@ -67,7 +67,7 @@ public class MetadataBatchScanTest {
     ClientOpts opts = new ClientOpts();
     opts.parseArgs(MetadataBatchScanTest.class.getName(), args);
     Instance inst = new ZooKeeperInstance(new ClientConfiguration().withInstance("acu14").withZkHosts("localhost"));
-    final Connector connector = inst.getConnector(opts.principal, opts.getToken());
+    final Connector connector = inst.getConnector(opts.getPrincipal(), opts.getToken());
 
     TreeSet<Long> splits = new TreeSet<Long>();
     Random r = new Random(42);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
b/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
index 00d1bf6..377a783 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
@@ -109,7 +109,7 @@ public class CollectTabletStats {
 
     Instance instance = opts.getInstance();
     final ServerConfigurationFactory sconf = new ServerConfigurationFactory(instance);
-    Credentials creds = new Credentials(opts.principal, opts.getToken());
+    Credentials creds = new Credentials(opts.getPrincipal(), opts.getToken());
     ClientContext context = new ClientContext(instance, creds, sconf.getConfiguration());
 
     String tableId = Tables.getNameToIdMap(instance).get(opts.getTableName());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7606aacf/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
b/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
index 13cad1a..0fdd7da 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
@@ -119,7 +119,7 @@ public class BulkSplitOptimizationIT extends AccumuloClusterIT {
     opts.rows = 100000;
     opts.startRow = 0;
     opts.cols = 1;
-    opts.password = new Password(new String(token.getPassword(), UTF_8));
+    opts.setPassword(new Password(new String(token.getPassword(), UTF_8)));
     opts.setTableName(tableName);
     VerifyIngest.verifyIngest(c, opts, new ScannerOpts());
 


Mime
View raw message