accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1454163 - in /accumulo/trunk: ./ core/ core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/ core/src/test/java/org/apache/accumulo/core/client/ core/src/test/java/org/apache/accumulo/core/client/admin/ core/src/test/java/...
Date Thu, 07 Mar 2013 23:20:30 GMT
Author: vines
Date: Thu Mar  7 23:20:30 2013
New Revision: 1454163

URL: http://svn.apache.org/r1454163
Log:
ACCUMULO-1156 - more cleanup, rest are a matter of updating Randomwalk and miniAccumuloCluster
to utilize the new framework better



Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/ClientSideIteratorTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormatTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormatTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormatTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
    accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/TestMergeState.java
    accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java
    accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java
    accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/BulkImportDirectory.java
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1454106-1454162

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/core:r1454106-1454162

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java
Thu Mar  7 23:20:30 2013
@@ -480,9 +480,6 @@ public class InputConfigurator extends C
     if ("MockInstance".equals(instanceType))
       return new MockTabletLocator();
     Instance instance = getInstance(implementingClass, conf);
-    String principal = getPrincipal(implementingClass, conf);
-    String tokenClass = getTokenClass(implementingClass, conf);
-    byte[] token = getToken(implementingClass, conf);
     String tableName = getInputTableName(implementingClass, conf);
     return TabletLocator.getInstance(instance, new Text(Tables.getTableId(instance, tableName)));
   }

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/ClientSideIteratorTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/ClientSideIteratorTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/ClientSideIteratorTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/ClientSideIteratorTest.java
Thu Mar  7 23:20:30 2013
@@ -25,6 +25,7 @@ import java.util.List;
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.PartialKey;
@@ -64,7 +65,7 @@ public class ClientSideIteratorTest {
   @Test
   public void testIntersect() throws Exception {
     Instance instance = new MockInstance("local");
-    Connector conn = instance.getConnector("root", "".getBytes());
+    Connector conn = instance.getConnector("root", new PasswordToken(""));
     conn.tableOperations().create("intersect");
     BatchWriter bw = conn.createBatchWriter("intersect", new BatchWriterConfig());
     Mutation m = new Mutation("part1");
@@ -94,7 +95,7 @@ public class ClientSideIteratorTest {
   @Test
   public void testVersioning() throws Exception {
     final Instance instance = new MockInstance("local");
-    final Connector conn = instance.getConnector("root", "".getBytes());
+    final Connector conn = instance.getConnector("root", new PasswordToken(""));
     conn.tableOperations().create("table");
     conn.tableOperations().removeProperty("table", "table.iterator.scan.vers");
     conn.tableOperations().removeProperty("table", "table.iterator.majc.vers");

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java
Thu Mar  7 23:20:30 2013
@@ -27,6 +27,7 @@ import org.apache.accumulo.core.client.B
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
@@ -49,7 +50,7 @@ public class FindMaxTest extends TestCas
   public void test1() throws Exception {
     MockInstance mi = new MockInstance();
     
-    Connector conn = mi.getConnector("root", "");
+    Connector conn = mi.getConnector("root", new PasswordToken(""));
     conn.tableOperations().create("foo");
     
     BatchWriter bw = conn.createBatchWriter("foo", new BatchWriterConfig());

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java
Thu Mar  7 23:20:30 2013
@@ -67,7 +67,7 @@ public class AccumuloFileOutputFormatTes
     folder.create();
     
     MockInstance mockInstance = new MockInstance(INSTANCE_NAME);
-    Connector c = mockInstance.getConnector("root", new byte[0]);
+    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
     c.tableOperations().create(EMPTY_TABLE);
     c.tableOperations().create(TEST_TABLE);
     c.tableOperations().create(BAD_TABLE);

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormatTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormatTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormatTest.java
Thu Mar  7 23:20:30 2013
@@ -267,7 +267,7 @@ public class AccumuloInputFormatTest {
   @Test
   public void testMap() throws Exception {
     MockInstance mockInstance = new MockInstance(INSTANCE_NAME);
-    Connector c = mockInstance.getConnector("root", "");
+    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
     c.tableOperations().create(TEST_TABLE_1);
     BatchWriter bw = c.createBatchWriter(TEST_TABLE_1, new BatchWriterConfig());
     for (int i = 0; i < 100; i++) {

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormatTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormatTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormatTest.java
Thu Mar  7 23:20:30 2013
@@ -179,7 +179,7 @@ public class AccumuloOutputFormatTest {
   @Test
   public void testMR() throws Exception {
     MockInstance mockInstance = new MockInstance(INSTANCE_NAME);
-    Connector c = mockInstance.getConnector("root", "");
+    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
     c.tableOperations().create(TEST_TABLE_1);
     c.tableOperations().create(TEST_TABLE_2);
     BatchWriter bw = c.createBatchWriter(TEST_TABLE_1, new BatchWriterConfig());

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormatTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormatTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormatTest.java
Thu Mar  7 23:20:30 2013
@@ -186,7 +186,7 @@ public class AccumuloRowInputFormatTest 
   @Test
   public void test() throws Exception {
     final MockInstance instance = new MockInstance(INSTANCE_NAME);
-    final Connector conn = instance.getConnector("root", "");
+    final Connector conn = instance.getConnector("root", new PasswordToken(""));
     conn.tableOperations().create(TEST_TABLE_1);
     BatchWriter writer = null;
     try {

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java
Thu Mar  7 23:20:30 2013
@@ -62,7 +62,7 @@ public class AccumuloFileOutputFormatTes
     folder.create();
     
     MockInstance mockInstance = new MockInstance(INSTANCE_NAME);
-    Connector c = mockInstance.getConnector("root", new byte[] {});
+    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
     c.tableOperations().create(EMPTY_TABLE);
     c.tableOperations().create(TEST_TABLE);
     c.tableOperations().create(BAD_TABLE);

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
Thu Mar  7 23:20:30 2013
@@ -304,7 +304,7 @@ public class AccumuloInputFormatTest {
   @Test
   public void testMap() throws Exception {
     MockInstance mockInstance = new MockInstance(INSTANCE_NAME);
-    Connector c = mockInstance.getConnector("root", new byte[] {});
+    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
     c.tableOperations().create(TEST_TABLE_1);
     BatchWriter bw = c.createBatchWriter(TEST_TABLE_1, new BatchWriterConfig());
     for (int i = 0; i < 100; i++) {

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
Thu Mar  7 23:20:30 2013
@@ -172,7 +172,7 @@ public class AccumuloOutputFormatTest {
   @Test
   public void testMR() throws Exception {
     MockInstance mockInstance = new MockInstance(INSTANCE_NAME);
-    Connector c = mockInstance.getConnector("root", new byte[] {});
+    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
     c.tableOperations().create(TEST_TABLE_1);
     c.tableOperations().create(TEST_TABLE_2);
     BatchWriter bw = c.createBatchWriter(TEST_TABLE_1, new BatchWriterConfig());

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java
Thu Mar  7 23:20:30 2013
@@ -181,7 +181,7 @@ public class AccumuloRowInputFormatTest 
   @Test
   public void test() throws Exception {
     final MockInstance instance = new MockInstance(INSTANCE_NAME);
-    final Connector conn = instance.getConnector("root", "".getBytes());
+    final Connector conn = instance.getConnector("root", new PasswordToken(""));
     conn.tableOperations().create(TEST_TABLE_1);
     BatchWriter writer = null;
     try {

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
Thu Mar  7 23:20:30 2013
@@ -96,7 +96,7 @@ public class MockConnectorTest {
   @Test
   public void testAggregation() throws Exception {
     MockInstance mockInstance = new MockInstance();
-    Connector c = mockInstance.getConnector("root", new byte[] {});
+    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
     String table = "perDayCounts";
     c.tableOperations().create(table);
     IteratorSetting is = new IteratorSetting(10, "String Summation", SummingCombiner.class);
@@ -343,8 +343,8 @@ public class MockConnectorTest {
   public void testMockConnectorReturnsCorrectInstance() throws AccumuloException, AccumuloSecurityException
{
     String name = "an-interesting-instance-name";
     Instance mockInstance = new MockInstance(name);
-    assertEquals(mockInstance, mockInstance.getConnector("foo", "bar").getInstance());
-    assertEquals(name, mockInstance.getConnector("foo", "bar").getInstance().getInstanceName());
+    assertEquals(mockInstance, mockInstance.getConnector("foo", new PasswordToken("bar")).getInstance());
+    assertEquals(name, mockInstance.getConnector("foo", new PasswordToken("bar")).getInstance().getInstanceName());
   }
   
 }

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java
Thu Mar  7 23:20:30 2013
@@ -27,6 +27,7 @@ import org.apache.accumulo.core.client.B
 import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.IteratorSetting;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Range;
@@ -38,7 +39,7 @@ public class TestBatchScanner821 {
   @Test
   public void test() throws Exception {
     MockInstance inst = new MockInstance();
-    Connector conn = inst.getConnector("root", "");
+    Connector conn = inst.getConnector("root", new PasswordToken(""));
     conn.tableOperations().create("test");
     BatchWriter bw = conn.createBatchWriter("test", new BatchWriterConfig());
     for (String row : "A,B,C,D".split(",")) {

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
Thu Mar  7 23:20:30 2013
@@ -35,6 +35,7 @@ import org.apache.accumulo.core.client.B
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
@@ -272,7 +273,7 @@ public class IntersectingIteratorTest ex
   public void testWithBatchScanner() throws Exception {
     Value empty = new Value(new byte[] {});
     MockInstance inst = new MockInstance("mockabye");
-    Connector connector = inst.getConnector("user", "pass");
+    Connector connector = inst.getConnector("user", new PasswordToken("pass"));
     connector.tableOperations().create("index");
     BatchWriter bw = connector.createBatchWriter("index", new BatchWriterConfig());
     Mutation m = new Mutation("000012");

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
Thu Mar  7 23:20:30 2013
@@ -30,6 +30,7 @@ import org.apache.accumulo.core.client.C
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
@@ -82,7 +83,7 @@ public class RowFilterTest extends TestC
 
   public void test1() throws Exception {
     MockInstance instance = new MockInstance("rft1");
-    Connector conn = instance.getConnector("", "".getBytes());
+    Connector conn = instance.getConnector("", new PasswordToken(""));
     
     conn.tableOperations().create("table1");
     BatchWriter bw = conn.createBatchWriter("table1", new BatchWriterConfig());

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java
Thu Mar  7 23:20:30 2013
@@ -41,6 +41,7 @@ import org.apache.accumulo.core.client.C
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.data.ArrayByteSequence;
 import org.apache.accumulo.core.data.ByteSequence;
@@ -69,7 +70,7 @@ public class TransformingIteratorTest {
   @Before
   public void setUpMockAccumulo() throws Exception {
     MockInstance instance = new MockInstance("test");
-    connector = instance.getConnector("user", "password");
+    connector = instance.getConnector("user", new PasswordToken("password"));
     connector.securityOperations().changeUserAuthorizations("user", authorizations);
     
     if (connector.tableOperations().exists(TABLE_NAME))
@@ -278,7 +279,7 @@ public class TransformingIteratorTest {
   @Test
   public void testDeepCopy() throws Exception {
     MockInstance instance = new MockInstance("test");
-    Connector connector = instance.getConnector("user", "password");
+    Connector connector = instance.getConnector("user", new PasswordToken("password"));
     
     connector.tableOperations().create("shard_table");
     

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/server:r1454106-1454162

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
Thu Mar  7 23:20:30 2013
@@ -19,6 +19,9 @@ package org.apache.accumulo.server.trace
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 import java.nio.channels.ServerSocketChannel;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Map.Entry;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.accumulo.trace.instrument.Span;
@@ -31,6 +34,8 @@ import org.apache.accumulo.core.client.B
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.client.MutationsRejectedException;
+import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.Mutation;
@@ -156,7 +161,25 @@ public class TraceServer implements Watc
     table = conf.get(Property.TRACE_TABLE);
     while (true) {
       try {
-        connector = serverConfiguration.getInstance().getConnector(conf.get(Property.TRACE_USER),
conf.get(Property.TRACE_PASSWORD).getBytes());
+        String principal = conf.get(Property.TRACE_PRINCIPAL);
+        if (principal == null)
+          principal = conf.get(Property.TRACE_USER);
+        AuthenticationToken at;
+        Map<String, String> loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_LOGIN_PROPERTIES);
+        if (loginMap == null)
+          at = new PasswordToken(conf.get(Property.TRACE_PASSWORD).getBytes());
+        else{
+          Properties props = new Properties();
+          int prefixLength = Property.TRACE_LOGIN_PROPERTIES.getKey().length()+1;
+          for (Entry<String, String> entry : loginMap.entrySet()) {
+            props.put(entry.getKey().substring(prefixLength), entry.getValue());
+          }
+          if (!props.containsKey("principal"))
+            props.put("principal", principal);
+          at = serverConfiguration.getInstance().getAuthenticator().login(props);
+        }
+        
+        connector = serverConfiguration.getInstance().getConnector(principal, at);
         if (!connector.tableOperations().exists(table)) {
           connector.tableOperations().create(table);
         }

Modified: accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/TestMergeState.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/TestMergeState.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/TestMergeState.java
(original)
+++ accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/TestMergeState.java
Thu Mar  7 23:20:30 2013
@@ -89,7 +89,7 @@ public class TestMergeState {
   @Test
   public void test() throws Exception {
     Instance instance = new MockInstance();
-    Connector connector = instance.getConnector("root", "");
+    Connector connector = instance.getConnector("root", new PasswordToken(""));
     BatchWriter bw = connector.createBatchWriter("!METADATA", new BatchWriterConfig());
     
     // Create a fake METADATA table with these splits

Modified: accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java
(original)
+++ accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java
Thu Mar  7 23:20:30 2013
@@ -29,6 +29,7 @@ import org.apache.accumulo.core.client.C
 import org.apache.accumulo.core.client.admin.TableOperations;
 import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.master.thrift.TableInfo;
 import org.apache.accumulo.core.master.thrift.TabletServerStatus;
@@ -105,7 +106,7 @@ public class TableLoadBalancerTest {
     @Override
     protected TableOperations getTableOperations() {
       try {
-        return instance.getConnector("user", "pass").tableOperations();
+        return instance.getConnector("user", new PasswordToken("pass")).tableOperations();
       } catch (Exception e) {
         throw new RuntimeException(e);
       }
@@ -126,7 +127,7 @@ public class TableLoadBalancerTest {
   
   @Test
   public void test() throws Exception {
-    Connector c = instance.getConnector("user", "pass".getBytes());
+    Connector c = instance.getConnector("user", new PasswordToken("pass"));
     c.tableOperations().create("t1");
     c.tableOperations().create("t2");
     c.tableOperations().create("t3");

Modified: accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java (original)
+++ accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java Thu
Mar  7 23:20:30 2013
@@ -27,6 +27,7 @@ import org.apache.accumulo.core.client.B
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.data.Mutation;
@@ -37,7 +38,7 @@ public class CloneTest extends TestCase 
   
   public void testNoFiles() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector("", new PasswordToken(""));
     
     KeyExtent ke = new KeyExtent(new Text("0"), null, null);
     Mutation mut = ke.getPrevRowUpdateMutation();
@@ -65,7 +66,7 @@ public class CloneTest extends TestCase 
   
   public void testFilesChange() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector("", new PasswordToken(""));
     
     KeyExtent ke = new KeyExtent(new Text("0"), null, null);
     Mutation mut = ke.getPrevRowUpdateMutation();
@@ -117,7 +118,7 @@ public class CloneTest extends TestCase 
   // test split where files of children are the same
   public void testSplit1() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector("", new PasswordToken(""));
     
     BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     
@@ -159,7 +160,7 @@ public class CloneTest extends TestCase 
   // test split where files of children differ... like majc and split occurred
   public void testSplit2() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector("", new PasswordToken(""));
     
     BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     
@@ -230,7 +231,7 @@ public class CloneTest extends TestCase 
   // test two tablets splitting into four
   public void testSplit3() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector("", new PasswordToken(""));
     
     BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     
@@ -277,7 +278,7 @@ public class CloneTest extends TestCase 
   public void testClonedMarker() throws Exception {
     
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector("", new PasswordToken(""));
     
     BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     
@@ -341,7 +342,7 @@ public class CloneTest extends TestCase 
   // test two tablets splitting into four
   public void testMerge() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector("", new PasswordToken(""));
     
     BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     

Modified: accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java
(original)
+++ accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java
Thu Mar  7 23:20:30 2013
@@ -26,6 +26,7 @@ import org.apache.accumulo.core.client.B
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.data.Mutation;
@@ -75,7 +76,7 @@ public class TabletIteratorTest extends 
   // simulate a merge happening while iterating over tablets
   public void testMerge() throws Exception {
     MockInstance mi = new MockInstance();
-    Connector conn = mi.getConnector("", "");
+    Connector conn = mi.getConnector("", new PasswordToken(""));
     
     KeyExtent ke1 = new KeyExtent(new Text("0"), new Text("m"), null);
     Mutation mut1 = ke1.getPrevRowUpdateMutation();

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/BulkImportDirectory.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/BulkImportDirectory.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/BulkImportDirectory.java (original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/BulkImportDirectory.java Thu
Mar  7 23:20:30 2013
@@ -24,6 +24,7 @@ import org.apache.accumulo.server.cli.Cl
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.server.client.HdfsZooInstance;
 import org.apache.hadoop.fs.FileSystem;
@@ -55,7 +56,7 @@ public class BulkImportDirectory {
       final Path failureDirPath = new Path(failureDir);
       fs.delete(failureDirPath, true);
       fs.mkdirs(failureDirPath);
-      HdfsZooInstance.getInstance().getConnector(user, pass).tableOperations().importDirectory(tableName,
dir, failureDir, false);
+      HdfsZooInstance.getInstance().getConnector(user, new PasswordToken(pass)).tableOperations().importDirectory(tableName,
dir, failureDir, false);
     } else {
       opts.parseArgs(BulkImportDirectory.class.getName(), args);
       fs.delete(new Path(opts.failures), true);

Modified: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java?rev=1454163&r1=1454162&r2=1454163&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java (original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java Thu
Mar  7 23:20:30 2013
@@ -30,6 +30,7 @@ import org.apache.accumulo.core.client.I
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.ScannerBase;
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Range;
@@ -45,7 +46,7 @@ public class RegExTest {
   
   @Test
   public void runTest() throws Exception {
-    conn = inst.getConnector("user", "pass");
+    conn = inst.getConnector("user", new PasswordToken("pass"));
     conn.tableOperations().create("ret");
     BatchWriter bw = conn.createBatchWriter("ret", new BatchWriterConfig());
     



Mime
View raw message