You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by mw...@apache.org on 2019/03/05 18:51:43 UTC
[accumulo] branch master updated: Inline createClient method in
ConfigurableMacBase (#1013)
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 94764fe Inline createClient method in ConfigurableMacBase (#1013)
94764fe is described below
commit 94764fe6aa942c0b9143a59a2063b141db394f06
Author: Mike Walch <mw...@apache.org>
AuthorDate: Tue Mar 5 13:51:35 2019 -0500
Inline createClient method in ConfigurableMacBase (#1013)
* Improve how client properties are created
* Reduce use of ClientInfo
---
.../hadoop/its/mapred/AccumuloOutputFormatIT.java | 13 ++---
.../accumulo/hadoop/its/mapreduce/RowHashIT.java | 3 +-
.../org/apache/accumulo/test/AuditMessageIT.java | 3 +-
.../org/apache/accumulo/test/BalanceFasterIT.java | 3 +-
.../accumulo/test/BalanceWithOfflineTableIT.java | 3 +-
.../accumulo/test/BulkImportMonitoringIT.java | 3 +-
.../test/ConfigurableMajorCompactionIT.java | 3 +-
.../accumulo/test/CountNameNodeOpsBulkIT.java | 3 +-
.../accumulo/test/DetectDeadTabletServersIT.java | 3 +-
.../org/apache/accumulo/test/ExistingMacIT.java | 3 +-
.../apache/accumulo/test/GarbageCollectWALIT.java | 3 +-
.../org/apache/accumulo/test/LargeSplitRowIT.java | 11 ++--
.../java/org/apache/accumulo/test/ManySplitIT.java | 3 +-
.../test/MasterRepairsDualAssignmentIT.java | 3 +-
.../apache/accumulo/test/MetaGetsReadersIT.java | 3 +-
.../org/apache/accumulo/test/MetaRecoveryIT.java | 3 +-
.../test/MissingWalHeaderCompletesRecoveryIT.java | 9 ++--
.../apache/accumulo/test/MultiTableRecoveryIT.java | 5 +-
.../accumulo/test/RewriteTabletDirectoriesIT.java | 3 +-
.../accumulo/test/TabletServerGivesUpIT.java | 3 +-
.../accumulo/test/TabletServerHdfsRestartIT.java | 3 +-
.../org/apache/accumulo/test/TotalQueuedIT.java | 3 +-
.../test/TracerRecoversAfterOfflineTableIT.java | 5 +-
.../java/org/apache/accumulo/test/UnusedWALIT.java | 5 +-
.../accumulo/test/VerifySerialRecoveryIT.java | 3 +-
.../accumulo/test/VolumeChooserFailureIT.java | 19 +++----
.../org/apache/accumulo/test/VolumeChooserIT.java | 35 ++++++------
.../java/org/apache/accumulo/test/VolumeIT.java | 62 +++++++++++-----------
.../org/apache/accumulo/test/WaitForBalanceIT.java | 3 +-
.../accumulo/test/functional/BackupMasterIT.java | 3 +-
.../functional/BalanceAfterCommsFailureIT.java | 3 +-
.../accumulo/test/functional/CleanTmpIT.java | 3 +-
.../test/functional/ConfigurableCompactionIT.java | 5 +-
.../test/functional/ConfigurableMacBase.java | 22 +-------
.../accumulo/test/functional/DurabilityIT.java | 15 +++---
.../test/functional/GarbageCollectorIT.java | 11 ++--
.../test/functional/HalfDeadTServerIT.java | 3 +-
.../test/functional/MetadataMaxFilesIT.java | 3 +-
.../accumulo/test/functional/MetadataSplitIT.java | 3 +-
.../accumulo/test/functional/MonitorSslIT.java | 3 +-
.../test/functional/RecoveryWithEmptyRFileIT.java | 35 ++++++------
.../test/functional/RegexGroupBalanceIT.java | 3 +-
.../test/functional/SessionDurabilityIT.java | 9 ++--
.../accumulo/test/functional/ShutdownIT.java | 5 +-
.../test/functional/SimpleBalancerFairnessIT.java | 3 +-
.../org/apache/accumulo/test/functional/SslIT.java | 17 +++---
.../accumulo/test/functional/WALSunnyDayIT.java | 3 +-
.../test/functional/WatchTheWatchCountIT.java | 8 ++-
.../accumulo/test/functional/ZooCacheIT.java | 3 +-
.../test/functional/ZookeeperRestartIT.java | 3 +-
.../CloseWriteAheadLogReferencesIT.java | 3 +-
.../test/mapred/AccumuloOutputFormatIT.java | 12 +++--
.../accumulo/test/mapreduce/MapReduceIT.java | 3 +-
.../apache/accumulo/test/mapreduce/RowHash.java | 12 +----
.../apache/accumulo/test/master/MergeStateIT.java | 3 +-
.../accumulo/test/master/SuspendedTabletsIT.java | 3 +-
.../test/performance/RollWALPerformanceIT.java | 3 +-
.../accumulo/test/proxy/ProxyDurabilityIT.java | 5 +-
.../test/replication/FinishedWorkUpdaterIT.java | 3 +-
...GarbageCollectorCommunicatesWithTServersIT.java | 9 ++--
.../replication/MultiInstanceReplicationIT.java | 9 ++--
.../replication/MultiTserverReplicationIT.java | 5 +-
.../RemoveCompleteReplicationRecordsIT.java | 3 +-
.../accumulo/test/replication/ReplicationIT.java | 27 +++++-----
.../replication/ReplicationOperationsImplIT.java | 3 +-
.../test/replication/SequentialWorkAssignerIT.java | 3 +-
.../accumulo/test/replication/StatusMakerIT.java | 3 +-
.../test/replication/UnorderedWorkAssignerIT.java | 3 +-
.../UnorderedWorkAssignerReplicationIT.java | 9 ++--
.../UnusedWalDoesntCloseReplicationStatusIT.java | 3 +-
.../accumulo/test/replication/WorkMakerIT.java | 3 +-
71 files changed, 282 insertions(+), 232 deletions(-)
diff --git a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/AccumuloOutputFormatIT.java b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/AccumuloOutputFormatIT.java
index 7291bad..d501749 100644
--- a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/AccumuloOutputFormatIT.java
+++ b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/AccumuloOutputFormatIT.java
@@ -70,9 +70,9 @@ public class AccumuloOutputFormatIT extends ConfigurableMacBase {
// Prevent regression of ACCUMULO-3709.
@Test
public void testMapred() throws Exception {
- try (AccumuloClient accumuloClient = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
// create a table and put some data in it
- accumuloClient.tableOperations().create(testName.getMethodName());
+ client.tableOperations().create(testName.getMethodName());
JobConf job = new JobConf();
BatchWriterConfig batchConfig = new BatchWriterConfig();
@@ -83,8 +83,9 @@ public class AccumuloOutputFormatIT extends ConfigurableMacBase {
// set the max memory so that we ensure we don't flush on the write.
batchConfig.setMaxMemory(Long.MAX_VALUE);
AccumuloOutputFormat outputFormat = new AccumuloOutputFormat();
- AccumuloOutputFormat.configure().clientProperties(getClientInfo(batchConfig).getProperties())
- .store(job);
+ Properties props = Accumulo.newClientProperties().from(getClientProperties())
+ .batchWriterConfig(batchConfig).build();
+ AccumuloOutputFormat.configure().clientProperties(props).store(job);
RecordWriter<Text,Mutation> writer = outputFormat.getRecordWriter(null, job, "Test", null);
try {
@@ -101,7 +102,7 @@ public class AccumuloOutputFormatIT extends ConfigurableMacBase {
// we don't want the exception to come from write
}
- accumuloClient.securityOperations().revokeTablePermission("root", testName.getMethodName(),
+ client.securityOperations().revokeTablePermission("root", testName.getMethodName(),
TablePermission.WRITE);
try {
@@ -200,7 +201,7 @@ public class AccumuloOutputFormatIT extends ConfigurableMacBase {
@Test
public void testMR() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String instanceName = getCluster().getInstanceName();
String table1 = instanceName + "_t1";
String table2 = instanceName + "_t2";
diff --git a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/RowHashIT.java b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/RowHashIT.java
index 06ba291..7ac8e08 100644
--- a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/RowHashIT.java
+++ b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/RowHashIT.java
@@ -25,6 +25,7 @@ import java.util.Base64;
import java.util.Collections;
import java.util.Map.Entry;
+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;
@@ -76,7 +77,7 @@ public class RowHashIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
runTest(client, getCluster());
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/AuditMessageIT.java b/test/src/main/java/org/apache/accumulo/test/AuditMessageIT.java
index 982fbcf..81d6a79 100644
--- a/test/src/main/java/org/apache/accumulo/test/AuditMessageIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/AuditMessageIT.java
@@ -29,6 +29,7 @@ import java.util.Collections;
import java.util.Map;
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;
@@ -161,7 +162,7 @@ public class AuditMessageIT extends ConfigurableMacBase {
@Before
public void resetInstance() throws Exception {
- client = createClient();
+ client = Accumulo.newClient().from(getClientProperties()).build();
removeUsersAndTables();
diff --git a/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java b/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java
index 28f3c97..339b7d2 100644
--- a/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java
@@ -29,6 +29,7 @@ import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
@@ -65,7 +66,7 @@ public class BalanceFasterIT extends ConfigurableMacBase {
public void test() throws Exception {
// create a table, add a bunch of splits
String tableName = getUniqueNames(1)[0];
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
client.tableOperations().create(tableName);
SortedSet<Text> splits = new TreeSet<>();
for (int i = 0; i < 1000; i++) {
diff --git a/test/src/main/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java b/test/src/main/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java
index 88ce36b..9e65b1c 100644
--- a/test/src/main/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java
@@ -21,6 +21,7 @@ import java.util.TreeSet;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.util.SimpleThreadPool;
import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
@@ -46,7 +47,7 @@ public class BalanceWithOfflineTableIT extends ConfigurableMacBase {
final String tableName = tableNames[0];
// create a table with a bunch of splits
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
log.info("Creating table {}", tableName);
c.tableOperations().create(tableName);
final SortedSet<Text> splits = new TreeSet<>();
diff --git a/test/src/main/java/org/apache/accumulo/test/BulkImportMonitoringIT.java b/test/src/main/java/org/apache/accumulo/test/BulkImportMonitoringIT.java
index 362bf79..6c5caad 100644
--- a/test/src/main/java/org/apache/accumulo/test/BulkImportMonitoringIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BulkImportMonitoringIT.java
@@ -28,6 +28,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.DefaultConfiguration;
import org.apache.accumulo.core.conf.Property;
@@ -61,7 +62,7 @@ public class BulkImportMonitoringIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
getCluster().getClusterControl().start(ServerType.MONITOR);
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
final String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
c.tableOperations().setProperty(tableName, Property.TABLE_MAJC_RATIO.getKey(), "1");
diff --git a/test/src/main/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java b/test/src/main/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
index e8fb2e5..44f3103 100644
--- a/test/src/main/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import java.util.Map;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -79,7 +80,7 @@ public class ConfigurableMajorCompactionIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
client.tableOperations().create(tableName);
client.tableOperations().setProperty(tableName, Property.TABLE_COMPACTION_STRATEGY.getKey(),
diff --git a/test/src/main/java/org/apache/accumulo/test/CountNameNodeOpsBulkIT.java b/test/src/main/java/org/apache/accumulo/test/CountNameNodeOpsBulkIT.java
index 67d86b6..39f5cdf 100644
--- a/test/src/main/java/org/apache/accumulo/test/CountNameNodeOpsBulkIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/CountNameNodeOpsBulkIT.java
@@ -31,6 +31,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.DefaultConfiguration;
import org.apache.accumulo.core.conf.Property;
@@ -92,7 +93,7 @@ public class CountNameNodeOpsBulkIT extends ConfigurableMacBase {
@Test
public void compareOldNewBulkImportTest() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
getCluster().getClusterControl().kill(ServerType.GARBAGE_COLLECTOR, "localhost");
final String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
diff --git a/test/src/main/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java b/test/src/main/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
index 9479063..3092e1e 100644
--- a/test/src/main/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertEquals;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.clientImpl.MasterClient;
@@ -51,7 +52,7 @@ public class DetectDeadTabletServersIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
log.info("verifying that everything is up");
Iterators.size(c.createScanner(MetadataTable.NAME, Authorizations.EMPTY).iterator());
diff --git a/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java b/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
index 702ad57..20d7eea 100644
--- a/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
@@ -29,6 +29,7 @@ import java.util.Map.Entry;
import java.util.Set;
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.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -156,7 +157,7 @@ public class ExistingMacIT extends ConfigurableMacBase {
@Test
public void testExistingRunningInstance() throws Exception {
final String table = getUniqueNames(1)[0];
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
// Ensure that a master and tserver are up so the existing instance check won't fail.
client.tableOperations().create(table);
try (BatchWriter bw = client.createBatchWriter(table)) {
diff --git a/test/src/main/java/org/apache/accumulo/test/GarbageCollectWALIT.java b/test/src/main/java/org/apache/accumulo/test/GarbageCollectWALIT.java
index 9e6b732..ef7f2b8 100644
--- a/test/src/main/java/org/apache/accumulo/test/GarbageCollectWALIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/GarbageCollectWALIT.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.test;
import static org.junit.Assert.assertEquals;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.metadata.MetadataTable;
@@ -53,7 +54,7 @@ public class GarbageCollectWALIT extends ConfigurableMacBase {
// not yet, please
String tableName = getUniqueNames(1)[0];
cluster.getClusterControl().stop(ServerType.GARBAGE_COLLECTOR);
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
c.tableOperations().create(tableName);
// count the number of WALs in the filesystem
assertEquals(2, countWALsInFS(cluster));
diff --git a/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java b/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java
index 9d16f5d..4265cca 100644
--- a/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java
@@ -27,6 +27,7 @@ import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -67,7 +68,7 @@ public class LargeSplitRowIT extends ConfigurableMacBase {
// make a table and lower the TABLE_END_ROW_MAX_SIZE property
final String tableName = getUniqueNames(1)[0];
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
client.tableOperations().create(tableName);
client.tableOperations().setProperty(tableName, Property.TABLE_MAX_END_ROW_SIZE.getKey(),
"1000");
@@ -121,7 +122,7 @@ public class LargeSplitRowIT extends ConfigurableMacBase {
// make a table and lower the configure properties
final String tableName = getUniqueNames(1)[0];
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
client.tableOperations().create(tableName);
client.tableOperations().setProperty(tableName, Property.TABLE_SPLIT_THRESHOLD.getKey(),
"10K");
@@ -180,7 +181,7 @@ public class LargeSplitRowIT extends ConfigurableMacBase {
@Test(timeout = 60 * 1000)
public void automaticSplitWithGaps() throws Exception {
log.info("Automatic Split With Gaps");
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
automaticSplit(client, 30, 2);
}
}
@@ -189,7 +190,7 @@ public class LargeSplitRowIT extends ConfigurableMacBase {
@Test(timeout = 60 * 1000)
public void automaticSplitWithoutGaps() throws Exception {
log.info("Automatic Split Without Gaps");
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
automaticSplit(client, 15, 1);
}
}
@@ -197,7 +198,7 @@ public class LargeSplitRowIT extends ConfigurableMacBase {
@Test(timeout = 60 * 1000)
public void automaticSplitLater() throws Exception {
log.info("Split later");
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
automaticSplit(client, 15, 1);
String tableName = new String();
diff --git a/test/src/main/java/org/apache/accumulo/test/ManySplitIT.java b/test/src/main/java/org/apache/accumulo/test/ManySplitIT.java
index 0d42cef..9b30c17 100644
--- a/test/src/main/java/org/apache/accumulo/test/ManySplitIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ManySplitIT.java
@@ -24,6 +24,7 @@ import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicBoolean;
+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;
@@ -59,7 +60,7 @@ public class ManySplitIT extends ConfigurableMacBase {
final String tableName = getUniqueNames(1)[0];
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
log.info("Creating table");
log.info("splitting metadata table");
diff --git a/test/src/main/java/org/apache/accumulo/test/MasterRepairsDualAssignmentIT.java b/test/src/main/java/org/apache/accumulo/test/MasterRepairsDualAssignmentIT.java
index 80faa0e..bb7062c 100644
--- a/test/src/main/java/org/apache/accumulo/test/MasterRepairsDualAssignmentIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MasterRepairsDualAssignmentIT.java
@@ -24,6 +24,7 @@ import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -69,7 +70,7 @@ public class MasterRepairsDualAssignmentIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
// make some tablets, spread 'em around
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
ClientContext context = (ClientContext) c;
String table = this.getUniqueNames(1)[0];
c.securityOperations().grantTablePermission("root", MetadataTable.NAME,
diff --git a/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java b/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
index d0112db..130daab 100644
--- a/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
@@ -28,6 +28,7 @@ import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.IteratorSetting;
@@ -80,7 +81,7 @@ public class MetaGetsReadersIT extends ConfigurableMacBase {
@Test(timeout = 2 * 60 * 1000)
public void test() throws Exception {
final String tableName = getUniqueNames(1)[0];
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
c.tableOperations().create(tableName);
Random random = new SecureRandom();
BatchWriter bw = c.createBatchWriter(tableName, null);
diff --git a/test/src/main/java/org/apache/accumulo/test/MetaRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/MetaRecoveryIT.java
index 1b7ac9c..9e93d0a 100644
--- a/test/src/main/java/org/apache/accumulo/test/MetaRecoveryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MetaRecoveryIT.java
@@ -22,6 +22,7 @@ import java.util.Collections;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
@@ -56,7 +57,7 @@ public class MetaRecoveryIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void test() throws Exception {
String[] tables = getUniqueNames(10);
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
int i = 0;
for (String table : tables) {
log.info("Creating table {}", i);
diff --git a/test/src/main/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java
index 2a8e880..b6e9e6d 100644
--- a/test/src/main/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.util.UUID;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -78,7 +79,7 @@ public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacBase {
@Before
public void setupMetadataPermission() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
rootHasWritePermission = client.securityOperations().hasTablePermission("root",
MetadataTable.NAME, TablePermission.WRITE);
if (!rootHasWritePermission) {
@@ -92,7 +93,7 @@ public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacBase {
@After
public void resetMetadataPermission() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
// Final state doesn't match the original
if (rootHasWritePermission != client.securityOperations().hasTablePermission("root",
MetadataTable.NAME, TablePermission.WRITE)) {
@@ -111,7 +112,7 @@ public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacBase {
@Test
public void testEmptyWalRecoveryCompletes() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
MiniAccumuloClusterImpl cluster = getCluster();
FileSystem fs = cluster.getFileSystem();
@@ -167,7 +168,7 @@ public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacBase {
@Test
public void testPartialHeaderWalRecoveryCompletes() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
MiniAccumuloClusterImpl cluster = getCluster();
FileSystem fs = getCluster().getFileSystem();
diff --git a/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
index 16d660e..5bc3af0 100644
--- a/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
@@ -27,6 +27,7 @@ import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -59,7 +60,7 @@ public class MultiTableRecoveryIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void testRecoveryOverMultipleTables() throws Exception {
final int N = 3;
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
final String[] tables = getUniqueNames(N);
final BatchWriter[] writers = new BatchWriter[N];
final byte[][] values = new byte[N][];
@@ -116,7 +117,7 @@ public class MultiTableRecoveryIT extends ConfigurableMacBase {
private Thread agitator(final AtomicBoolean stop) {
return new Thread(() -> {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
int i = 0;
while (!stop.get()) {
sleepUninterruptibly(10, TimeUnit.SECONDS);
diff --git a/test/src/main/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java b/test/src/main/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java
index be5c404..0d6d8ba 100644
--- a/test/src/main/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java
@@ -27,6 +27,7 @@ import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
@@ -80,7 +81,7 @@ public class RewriteTabletDirectoriesIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
c.securityOperations().grantTablePermission(c.whoami(), MetadataTable.NAME,
TablePermission.WRITE);
final String tableName = getUniqueNames(1)[0];
diff --git a/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java b/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java
index f06f74e..cd1edb6 100644
--- a/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java
@@ -22,6 +22,7 @@ import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
@@ -45,7 +46,7 @@ public class TabletServerGivesUpIT extends ConfigurableMacBase {
@Test(timeout = 45 * 1000)
public void test() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
while (client.instanceOperations().getTabletServers().isEmpty()) {
// Wait until at least one tablet server is up
Thread.sleep(100);
diff --git a/test/src/main/java/org/apache/accumulo/test/TabletServerHdfsRestartIT.java b/test/src/main/java/org/apache/accumulo/test/TabletServerHdfsRestartIT.java
index 5bfead7..6e7b599 100644
--- a/test/src/main/java/org/apache/accumulo/test/TabletServerHdfsRestartIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TabletServerHdfsRestartIT.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.test;
import static org.junit.Assert.assertEquals;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.conf.Property;
@@ -44,7 +45,7 @@ public class TabletServerHdfsRestartIT extends ConfigurableMacBase {
@Test(timeout = 2 * 60 * 1000)
public void test() throws Exception {
- try (AccumuloClient client = this.createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
// wait until a tablet server is up
while (client.instanceOperations().getTabletServers().isEmpty()) {
Thread.sleep(50);
diff --git a/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java b/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
index b86ca83..8df9dcd 100644
--- a/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
@@ -23,6 +23,7 @@ import java.security.SecureRandom;
import java.util.Random;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -56,7 +57,7 @@ public class TotalQueuedIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void test() throws Exception {
Random random = new SecureRandom();
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
c.instanceOperations().setProperty(Property.TSERV_TOTAL_MUTATION_QUEUE_MAX.getKey(),
"" + SMALL_QUEUE_SIZE);
String tableName = getUniqueNames(1)[0];
diff --git a/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java b/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java
index f98bea6..1e593e9 100644
--- a/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertTrue;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -55,7 +56,7 @@ public class TracerRecoversAfterOfflineTableIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
Process tracer = null;
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
if (!client.tableOperations().exists("trace")) {
MiniAccumuloClusterImpl mac = cluster;
tracer = mac.exec(TraceServer.class).getProcess();
@@ -73,7 +74,7 @@ public class TracerRecoversAfterOfflineTableIT extends ConfigurableMacBase {
log.info("Start a distributed trace span");
- TraceUtil.enableClientTraces("localhost", "testTrace", getClientInfo().getProperties());
+ TraceUtil.enableClientTraces("localhost", "testTrace", getClientProperties());
long rootTraceId;
try (TraceScope root = Trace.startSpan("traceTest", Sampler.ALWAYS)) {
rootTraceId = root.getSpan().getTraceId();
diff --git a/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java b/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java
index 33f5f41..6d861d8 100644
--- a/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map.Entry;
import java.util.UUID;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -78,12 +79,12 @@ public class UnusedWALIT extends ConfigurableMacBase {
String[] tableNames = getUniqueNames(2);
String bigTable = tableNames[0];
String lilTable = tableNames[1];
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
c.tableOperations().create(bigTable);
c.tableOperations().create(lilTable);
ServerContext context = getServerContext();
- ClientInfo info = getClientInfo();
+ ClientInfo info = ClientInfo.from(getClientProperties());
new ZooReaderWriter(info.getZooKeepers(), info.getZooKeepersSessionTimeOut(), "");
// put some data in a log that should be replayed for both tables
diff --git a/test/src/main/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java
index bd6d617..0eaaf4a 100644
--- a/test/src/main/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java
@@ -25,6 +25,7 @@ import java.util.Random;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.conf.Property;
@@ -74,7 +75,7 @@ public class VerifySerialRecoveryIT extends ConfigurableMacBase {
public void testSerializedRecovery() throws Exception {
// make a table with many splits
String tableName = getUniqueNames(1)[0];
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
c.tableOperations().create(tableName);
SortedSet<Text> splits = new TreeSet<>();
for (int i = 0; i < 200; i++) {
diff --git a/test/src/main/java/org/apache/accumulo/test/VolumeChooserFailureIT.java b/test/src/main/java/org/apache/accumulo/test/VolumeChooserFailureIT.java
index 7ba2cde..5f92056 100644
--- a/test/src/main/java/org/apache/accumulo/test/VolumeChooserFailureIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/VolumeChooserFailureIT.java
@@ -25,6 +25,7 @@ import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -119,18 +120,18 @@ public class VolumeChooserFailureIT extends ConfigurableMacBase {
log.info("Starting missingVolumePreferredVolumeChooser");
// Create namespace
- try (AccumuloClient accumuloClient = createClient()) {
- accumuloClient.namespaceOperations().create(namespace1);
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
+ client.namespaceOperations().create(namespace1);
// Set properties on the namespace
- accumuloClient.namespaceOperations().setProperty(namespace1, PERTABLE_CHOOSER_PROP,
+ client.namespaceOperations().setProperty(namespace1, PERTABLE_CHOOSER_PROP,
PreferredVolumeChooser.class.getName());
// deliberately do not set preferred volumes
// Create table1 on namespace1 (will fail)
String tableName = namespace1 + ".1";
thrown.expect(AccumuloException.class);
- accumuloClient.tableOperations().create(tableName);
+ client.tableOperations().create(tableName);
}
}
@@ -142,24 +143,24 @@ public class VolumeChooserFailureIT extends ConfigurableMacBase {
log.info("Starting notInstancePreferredVolumeChooser");
// Create namespace
- try (AccumuloClient accumuloClient = createClient()) {
- accumuloClient.namespaceOperations().create(namespace1);
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
+ client.namespaceOperations().create(namespace1);
// Set properties on the namespace
String propertyName = PERTABLE_CHOOSER_PROP;
String volume = PreferredVolumeChooser.class.getName();
- accumuloClient.namespaceOperations().setProperty(namespace1, propertyName, volume);
+ client.namespaceOperations().setProperty(namespace1, propertyName, volume);
// set to v3 which is not included in the list of instance volumes, so it should go to the
// system default preferred volumes
propertyName = PREFERRED_CHOOSER_PROP;
volume = v3.toString();
- accumuloClient.namespaceOperations().setProperty(namespace1, propertyName, volume);
+ client.namespaceOperations().setProperty(namespace1, propertyName, volume);
// Create table1 on namespace1 (will fail)
String tableName = namespace1 + ".1";
thrown.expect(AccumuloException.class);
- accumuloClient.tableOperations().create(tableName);
+ client.tableOperations().create(tableName);
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java b/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java
index 931d0f0..bf77105 100644
--- a/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java
@@ -28,6 +28,7 @@ import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -271,7 +272,7 @@ public class VolumeChooserIT extends ConfigurableMacBase {
log.info("Starting twoTablesPreferredVolumeChooser");
// Create namespace
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
// Set properties on the namespace
// namespace 1 -> v2
configureNamespace(c, PreferredVolumeChooser.class.getName(), v2.toString(), namespace1);
@@ -293,21 +294,21 @@ public class VolumeChooserIT extends ConfigurableMacBase {
log.info("Starting twoTablesRandomVolumeChooser()");
// Create namespace
- try (AccumuloClient accumuloClient = createClient()) {
- createAndVerify(accumuloClient, namespace1, v1 + "," + v2 + "," + v4);
- createAndVerify(accumuloClient, namespace2, v1 + "," + v2 + "," + v4);
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
+ createAndVerify(client, namespace1, v1 + "," + v2 + "," + v4);
+ createAndVerify(client, namespace2, v1 + "," + v2 + "," + v4);
}
}
- private void createAndVerify(AccumuloClient accumuloClient, String ns, String expectedVolumes)
+ private void createAndVerify(AccumuloClient client, String ns, String expectedVolumes)
throws Exception {
- accumuloClient.namespaceOperations().create(ns);
+ client.namespaceOperations().create(ns);
// Set properties on the namespace
- accumuloClient.namespaceOperations().setProperty(ns, PERTABLE_CHOOSER_PROP,
+ client.namespaceOperations().setProperty(ns, PERTABLE_CHOOSER_PROP,
RandomVolumeChooser.class.getName());
- verifyVolumesForWritesToNewTable(accumuloClient, ns, expectedVolumes);
+ verifyVolumesForWritesToNewTable(client, ns, expectedVolumes);
}
// Test that uses 2 tables with 10 split points each. The first uses the RandomVolumeChooser and
@@ -317,7 +318,7 @@ public class VolumeChooserIT extends ConfigurableMacBase {
log.info("Starting twoTablesDiffChoosers");
// Create namespace
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
createAndVerify(c, namespace1, v1 + "," + v2 + "," + v4);
configureNamespace(c, PreferredVolumeChooser.class.getName(), v1.toString(), namespace2);
// Create table2 on namespace2
@@ -328,13 +329,13 @@ public class VolumeChooserIT extends ConfigurableMacBase {
@Test
public void includeSpecialVolumeForTable() throws Exception {
log.info("Starting includeSpecialVolumeForTable");
- try (AccumuloClient accumuloClient = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
// the following table will be configured to go to the excluded volume
String configuredVolumes = v4.toString();
- configureNamespace(accumuloClient, PreferredVolumeChooser.class.getName(), configuredVolumes,
+ configureNamespace(client, PreferredVolumeChooser.class.getName(), configuredVolumes,
namespace2);
- verifyVolumesForWritesToNewTable(accumuloClient, namespace2, configuredVolumes);
+ verifyVolumesForWritesToNewTable(client, namespace2, configuredVolumes);
}
}
@@ -342,14 +343,14 @@ public class VolumeChooserIT extends ConfigurableMacBase {
public void waLogsSentToConfiguredVolumes() throws Exception {
log.info("Starting waLogsSentToConfiguredVolumes");
- try (AccumuloClient accumuloClient = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = "anotherTable";
- accumuloClient.tableOperations().create(tableName);
+ client.tableOperations().create(tableName);
- VolumeChooserIT.addSplits(accumuloClient, tableName);
- VolumeChooserIT.writeDataToTable(accumuloClient, tableName, alpha_rows);
+ VolumeChooserIT.addSplits(client, tableName);
+ VolumeChooserIT.writeDataToTable(client, tableName, alpha_rows);
// should only go to v2 as per configuration in configure()
- VolumeChooserIT.verifyWaLogVolumes(accumuloClient, new Range(), v2.toString());
+ VolumeChooserIT.verifyWaLogVolumes(client, new Range(), v2.toString());
}
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/VolumeIT.java b/test/src/main/java/org/apache/accumulo/test/VolumeIT.java
index dcf9ac1..1749c10 100644
--- a/test/src/main/java/org/apache/accumulo/test/VolumeIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/VolumeIT.java
@@ -34,6 +34,7 @@ import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -126,27 +127,26 @@ public class VolumeIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
// create a table
- try (AccumuloClient accumuloClient = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
- accumuloClient.tableOperations().create(tableName);
+ client.tableOperations().create(tableName);
SortedSet<Text> partitions = new TreeSet<>();
// with some splits
for (String s : "d,m,t".split(","))
partitions.add(new Text(s));
- accumuloClient.tableOperations().addSplits(tableName, partitions);
+ client.tableOperations().addSplits(tableName, partitions);
// scribble over the splits
- VolumeChooserIT.writeDataToTable(accumuloClient, tableName, VolumeChooserIT.alpha_rows);
+ VolumeChooserIT.writeDataToTable(client, tableName, VolumeChooserIT.alpha_rows);
// write the data to disk, read it back
- accumuloClient.tableOperations().flush(tableName, null, null, true);
- try (Scanner scanner = accumuloClient.createScanner(tableName, Authorizations.EMPTY)) {
+ client.tableOperations().flush(tableName, null, null, true);
+ try (Scanner scanner = client.createScanner(tableName, Authorizations.EMPTY)) {
int i = 0;
for (Entry<Key,Value> entry : scanner) {
assertEquals(VolumeChooserIT.alpha_rows[i++], entry.getKey().getRow().toString());
}
}
// verify the new files are written to the different volumes
- try (Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME,
- Authorizations.EMPTY)) {
+ try (Scanner scanner = client.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
scanner.setRange(new Range("1", "1<"));
scanner.fetchColumnFamily(DataFileColumnFamily.NAME);
int fileCount = 0;
@@ -158,7 +158,7 @@ public class VolumeIT extends ConfigurableMacBase {
fileCount++;
}
assertEquals(4, fileCount);
- List<DiskUsage> diskUsage = accumuloClient.tableOperations()
+ List<DiskUsage> diskUsage = client.tableOperations()
.getDiskUsage(Collections.singleton(tableName));
assertEquals(1, diskUsage.size());
long usage = diskUsage.get(0).getUsage();
@@ -190,21 +190,21 @@ public class VolumeIT extends ConfigurableMacBase {
List<String> expected = new ArrayList<>();
- try (AccumuloClient accumuloClient = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
- accumuloClient.tableOperations().create(tableName,
+ client.tableOperations().create(tableName,
new NewTableConfiguration().withoutDefaultIterators());
- TableId tableId = TableId.of(accumuloClient.tableOperations().tableIdMap().get(tableName));
+ TableId tableId = TableId.of(client.tableOperations().tableIdMap().get(tableName));
SortedSet<Text> partitions = new TreeSet<>();
// with some splits
for (String s : "c,g,k,p,s,v".split(","))
partitions.add(new Text(s));
- accumuloClient.tableOperations().addSplits(tableName, partitions);
+ client.tableOperations().addSplits(tableName, partitions);
- BatchWriter bw = accumuloClient.createBatchWriter(tableName, new BatchWriterConfig());
+ BatchWriter bw = client.createBatchWriter(tableName, new BatchWriterConfig());
// create two files in each tablet
for (String s : VolumeChooserIT.alpha_rows) {
@@ -215,7 +215,7 @@ public class VolumeIT extends ConfigurableMacBase {
}
bw.flush();
- accumuloClient.tableOperations().flush(tableName, null, null, true);
+ client.tableOperations().flush(tableName, null, null, true);
for (String s : VolumeChooserIT.alpha_rows) {
Mutation m = new Mutation(s);
@@ -225,22 +225,20 @@ public class VolumeIT extends ConfigurableMacBase {
}
bw.close();
- accumuloClient.tableOperations().flush(tableName, null, null, true);
+ client.tableOperations().flush(tableName, null, null, true);
- verifyData(expected, accumuloClient.createScanner(tableName, Authorizations.EMPTY));
+ verifyData(expected, client.createScanner(tableName, Authorizations.EMPTY));
- accumuloClient.tableOperations().offline(tableName, true);
+ client.tableOperations().offline(tableName, true);
- accumuloClient.securityOperations().grantTablePermission("root", MetadataTable.NAME,
+ client.securityOperations().grantTablePermission("root", MetadataTable.NAME,
TablePermission.WRITE);
- try (Scanner metaScanner = accumuloClient.createScanner(MetadataTable.NAME,
- Authorizations.EMPTY)) {
+ try (Scanner metaScanner = client.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
metaScanner.fetchColumnFamily(MetadataSchema.TabletsSection.DataFileColumnFamily.NAME);
metaScanner.setRange(new KeyExtent(tableId, null, null).toMetadataRange());
- BatchWriter mbw = accumuloClient.createBatchWriter(MetadataTable.NAME,
- new BatchWriterConfig());
+ BatchWriter mbw = client.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig());
for (Entry<Key,Value> entry : metaScanner) {
String cq = entry.getKey().getColumnQualifier().toString();
@@ -258,13 +256,13 @@ public class VolumeIT extends ConfigurableMacBase {
mbw.close();
- accumuloClient.tableOperations().online(tableName, true);
+ client.tableOperations().online(tableName, true);
- verifyData(expected, accumuloClient.createScanner(tableName, Authorizations.EMPTY));
+ verifyData(expected, client.createScanner(tableName, Authorizations.EMPTY));
- accumuloClient.tableOperations().compact(tableName, null, null, true, true);
+ client.tableOperations().compact(tableName, null, null, true, true);
- verifyData(expected, accumuloClient.createScanner(tableName, Authorizations.EMPTY));
+ verifyData(expected, client.createScanner(tableName, Authorizations.EMPTY));
for (Entry<Key,Value> entry : metaScanner) {
String cq = entry.getKey().getColumnQualifier().toString();
@@ -277,7 +275,7 @@ public class VolumeIT extends ConfigurableMacBase {
@Test
public void testAddVolumes() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String[] tableNames = getUniqueNames(2);
PropertiesConfiguration conf = new PropertiesConfiguration();
@@ -319,7 +317,7 @@ public class VolumeIT extends ConfigurableMacBase {
String[] tableNames = getUniqueNames(2);
PropertiesConfiguration conf = new PropertiesConfiguration();
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String uuid = verifyAndShutdownCluster(client, conf, tableNames[0]);
conf.setProperty(Property.INSTANCE_VOLUMES.getKey(), v2 + "," + v3);
@@ -457,7 +455,7 @@ public class VolumeIT extends ConfigurableMacBase {
@Test
public void testRemoveVolumes() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String[] tableNames = getUniqueNames(2);
verifyVolumesUsed(client, tableNames[0], false, v1, v2);
@@ -560,14 +558,14 @@ public class VolumeIT extends ConfigurableMacBase {
@Test
public void testCleanReplaceVolumes() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
testReplaceVolume(client, true);
}
}
@Test
public void testDirtyReplaceVolumes() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
testReplaceVolume(client, false);
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/WaitForBalanceIT.java b/test/src/main/java/org/apache/accumulo/test/WaitForBalanceIT.java
index 4dbefdf..c5c1d61 100644
--- a/test/src/main/java/org/apache/accumulo/test/WaitForBalanceIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/WaitForBalanceIT.java
@@ -25,6 +25,7 @@ import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
@@ -48,7 +49,7 @@ public class WaitForBalanceIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
// ensure the metadata table is online
Iterators.size(c.createScanner(MetadataTable.NAME, Authorizations.EMPTY).iterator());
c.instanceOperations().waitForBalance();
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BackupMasterIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BackupMasterIT.java
index 3cd927c..8a4bbb0 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BackupMasterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BackupMasterIT.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.test.functional;
import java.util.Collections;
import java.util.List;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.fate.util.UtilWaitThread;
@@ -41,7 +42,7 @@ public class BackupMasterIT extends ConfigurableMacBase {
UtilWaitThread.sleep(1000);
// create a backup
Process backup = exec(Master.class);
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String secret = getCluster().getSiteConfiguration().get(Property.INSTANCE_SECRET);
IZooReaderWriter writer = new ZooReaderWriterFactory()
.getZooReaderWriter(cluster.getZooKeepers(), 30 * 1000, secret);
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java
index 0551f23..bfcccc0 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java
@@ -28,6 +28,7 @@ import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.clientImpl.MasterClient;
@@ -63,7 +64,7 @@ public class BalanceAfterCommsFailureIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient c = this.createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
c.tableOperations().create("test");
Collection<ProcessReference> tservers = getCluster().getProcesses()
.get(ServerType.TABLET_SERVER);
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/CleanTmpIT.java b/test/src/main/java/org/apache/accumulo/test/functional/CleanTmpIT.java
index 5d9eb71..10a3d29 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/CleanTmpIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/CleanTmpIT.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertTrue;
import java.util.Map.Entry;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -64,7 +65,7 @@ public class CleanTmpIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
// make a table
String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableCompactionIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableCompactionIT.java
index cec0ff5..3c0ec86 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableCompactionIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableCompactionIT.java
@@ -28,6 +28,7 @@ import java.util.Map;
import java.util.Random;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -90,7 +91,7 @@ public class ConfigurableCompactionIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
final String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
c.tableOperations().setProperty(tableName, Property.TABLE_COMPACTION_STRATEGY.getKey(),
@@ -104,7 +105,7 @@ public class ConfigurableCompactionIT extends ConfigurableMacBase {
@Test
public void testPerTableClasspath() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
final String tableName = getUniqueNames(1)[0];
File destFile = installJar(getCluster().getConfig().getAccumuloDir(),
"/TestCompactionStrat.jar");
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 aa87f21..8f842dd 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
@@ -27,10 +27,6 @@ import java.util.Map;
import java.util.Properties;
import org.apache.accumulo.core.client.Accumulo;
-import org.apache.accumulo.core.client.AccumuloClient;
-import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.security.tokens.PasswordToken;
-import org.apache.accumulo.core.clientImpl.ClientInfo;
import org.apache.accumulo.core.conf.ClientProperty;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.harness.AccumuloClusterHarness;
@@ -189,24 +185,10 @@ public class ConfigurableMacBase extends AccumuloITBase {
return cluster;
}
- protected AccumuloClient createClient() {
- return getCluster().createAccumuloClient("root", new PasswordToken(ROOT_PASSWORD));
- }
-
protected Properties getClientProperties() {
- return getClientInfo().getProperties();
- }
-
- protected ClientInfo getClientInfo() {
- return ClientInfo.from(Accumulo.newClientProperties()
- .to(getCluster().getInstanceName(), getCluster().getZooKeepers()).as("root", ROOT_PASSWORD)
- .build());
- }
-
- protected ClientInfo getClientInfo(BatchWriterConfig bwConfig) {
- return ClientInfo.from(Accumulo.newClientProperties()
+ return Accumulo.newClientProperties()
.to(getCluster().getInstanceName(), getCluster().getZooKeepers()).as("root", ROOT_PASSWORD)
- .batchWriterConfig(bwConfig).build());
+ .build();
}
protected ServerContext getServerContext() {
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/DurabilityIT.java b/test/src/main/java/org/apache/accumulo/test/functional/DurabilityIT.java
index b4688f0..375e9e2 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/DurabilityIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/DurabilityIT.java
@@ -25,6 +25,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.admin.TableOperations;
@@ -92,7 +93,7 @@ public class DurabilityIT extends ConfigurableMacBase {
@Test(timeout = 2 * 60 * 1000)
public void testWriteSpeed() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
TableOperations tableOps = client.tableOperations();
String[] tableNames = init(client);
// write some gunk, delete the table to keep that table from messing with the performance
@@ -118,7 +119,7 @@ public class DurabilityIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void testSync() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String[] tableNames = init(client);
// sync table should lose nothing
writeSome(client, tableNames[0], N);
@@ -130,7 +131,7 @@ public class DurabilityIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void testFlush() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String[] tableNames = init(client);
// flush table won't lose anything since we're not losing power/dfs
writeSome(client, tableNames[1], N);
@@ -142,7 +143,7 @@ public class DurabilityIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void testLog() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String[] tableNames = init(client);
// we're probably going to lose something the the log setting
writeSome(client, tableNames[2], N);
@@ -155,7 +156,7 @@ public class DurabilityIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void testNone() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String[] tableNames = init(client);
// probably won't get any data back without logging
writeSome(client, tableNames[3], N);
@@ -168,7 +169,7 @@ public class DurabilityIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void testIncreaseDurability() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
c.tableOperations().setProperty(tableName, Property.TABLE_DURABILITY.getKey(), "none");
@@ -193,7 +194,7 @@ public class DurabilityIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void testMetaDurability() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
c.instanceOperations().setProperty(Property.TABLE_DURABILITY.getKey(), "none");
Map<String,String> props = map(c.tableOperations().getProperties(MetadataTable.NAME));
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java b/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
index 91b924d..e83f23c 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
@@ -33,6 +33,7 @@ import java.util.Map.Entry;
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.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -111,7 +112,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
public void gcTest() throws Exception {
killMacGc();
final String table = "test_ingest";
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
c.tableOperations().create(table);
c.tableOperations().setProperty(table, Property.TABLE_SPLIT_THRESHOLD.getKey(), "5K");
VerifyParams params = new VerifyParams(getClientProperties(), table, 10_000);
@@ -141,7 +142,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
killMacGc();
log.info("Filling metadata table with bogus delete flags");
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
addEntries(c);
cluster.getConfig().setDefaultMemory(10, MemoryUnit.MEGABYTE);
ProcessInfo gc = cluster.exec(SimpleGarbageCollector.class);
@@ -163,7 +164,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
public void dontGCRootLog() throws Exception {
killMacGc();
// dirty metadata
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String table = getUniqueNames(1)[0];
c.tableOperations().create(table);
// let gc run for a bit
@@ -193,7 +194,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
@Test
public void testInvalidDelete() throws Exception {
killMacGc();
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String table = getUniqueNames(1)[0];
c.tableOperations().create(table);
@@ -245,7 +246,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
@Test
public void testProperPortAdvertisement() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
ZooReaderWriter zk = new ZooReaderWriter(cluster.getZooKeepers(), 30000, OUR_SECRET);
String path = ZooUtil.getRoot(client.instanceOperations().getInstanceID())
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java b/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
index 9ffbeaf..764cd44 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
@@ -31,6 +31,7 @@ import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.util.Daemon;
@@ -118,7 +119,7 @@ public class HalfDeadTServerIT extends ConfigurableMacBase {
public String test(int seconds, boolean expectTserverDied) throws Exception {
if (!makeDiskFailureLibrary())
return null;
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
while (c.instanceOperations().getTabletServers().isEmpty()) {
// wait until a tserver is running
Thread.sleep(50);
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java
index 1bc18fc..ce74786 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java
@@ -24,6 +24,7 @@ import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.clientImpl.MasterClient;
@@ -60,7 +61,7 @@ public class MetadataMaxFilesIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
SortedSet<Text> splits = new TreeSet<>();
for (int i = 0; i < 1000; i++) {
splits.add(new Text(String.format("%03d", i)));
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MetadataSplitIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MetadataSplitIT.java
index 2ec02d7..bcb4605 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/MetadataSplitIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/MetadataSplitIT.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertTrue;
import java.util.Collections;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.metadata.MetadataTable;
@@ -44,7 +45,7 @@ public class MetadataSplitIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
assertEquals(1, c.tableOperations().listSplits(MetadataTable.NAME).size());
c.tableOperations().setProperty(MetadataTable.NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(),
"500");
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MonitorSslIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MonitorSslIT.java
index f4e50fa..24959b4 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/MonitorSslIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/MonitorSslIT.java
@@ -34,6 +34,7 @@ import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.conf.Property;
@@ -125,7 +126,7 @@ public class MonitorSslIT extends ConfigurableMacBase {
log.debug("Starting Monitor");
cluster.getClusterControl().startAllServers(ServerType.MONITOR);
String monitorLocation = null;
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
while (monitorLocation == null) {
try {
monitorLocation = MonitorUtil.getLocation((ClientContext) client);
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/RecoveryWithEmptyRFileIT.java b/test/src/main/java/org/apache/accumulo/test/functional/RecoveryWithEmptyRFileIT.java
index 4a88a90..0e365a9 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/RecoveryWithEmptyRFileIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/RecoveryWithEmptyRFileIT.java
@@ -20,9 +20,12 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.Map.Entry;
+import java.util.Properties;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.clientImpl.ClientInfo;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
@@ -51,9 +54,8 @@ import org.slf4j.LoggerFactory;
public class RecoveryWithEmptyRFileIT extends ConfigurableMacBase {
private static final Logger log = LoggerFactory.getLogger(RecoveryWithEmptyRFileIT.class);
- static final int ROWS = 200000;
- static final int COLS = 1;
- static final String COLF = "colf";
+ private static final int ROWS = 200000;
+ private static final int COLS = 1;
@Override
protected int defaultTimeoutSeconds() {
@@ -69,17 +71,19 @@ public class RecoveryWithEmptyRFileIT extends ConfigurableMacBase {
public void replaceMissingRFile() throws Exception {
log.info("Ingest some data, verify it was stored properly, replace an"
+ " underlying rfile with an empty one and verify we can scan.");
- try (AccumuloClient accumuloClient = createClient()) {
+ Properties props = getClientProperties();
+ ClientInfo info = ClientInfo.from(props);
+ try (AccumuloClient client = Accumulo.newClient().from(props).build()) {
String tableName = getUniqueNames(1)[0];
- ReadWriteIT.ingest(accumuloClient, getClientInfo(), ROWS, COLS, 50, 0, tableName);
- ReadWriteIT.verify(accumuloClient, getClientInfo(), ROWS, COLS, 50, 0, tableName);
+ ReadWriteIT.ingest(client, info, ROWS, COLS, 50, 0, tableName);
+ ReadWriteIT.verify(client, info, ROWS, COLS, 50, 0, tableName);
- accumuloClient.tableOperations().flush(tableName, null, null, true);
- accumuloClient.tableOperations().offline(tableName, true);
+ client.tableOperations().flush(tableName, null, null, true);
+ client.tableOperations().offline(tableName, true);
log.debug("Replacing rfile(s) with empty");
- try (Scanner meta = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
- String tableId = accumuloClient.tableOperations().tableIdMap().get(tableName);
+ try (Scanner meta = client.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
+ String tableId = client.tableOperations().tableIdMap().get(tableName);
meta.setRange(new Range(new Text(tableId + ";"), new Text(tableId + "<")));
meta.fetchColumnFamily(DataFileColumnFamily.NAME);
boolean foundFile = false;
@@ -88,18 +92,18 @@ public class RecoveryWithEmptyRFileIT extends ConfigurableMacBase {
Path rfile = new Path(entry.getKey().getColumnQualifier().toString());
log.debug("Removing rfile '{}'", rfile);
cluster.getFileSystem().delete(rfile, false);
- Process info = cluster.exec(CreateEmpty.class, rfile.toString()).getProcess();
- assertEquals(0, info.waitFor());
+ Process processInfo = cluster.exec(CreateEmpty.class, rfile.toString()).getProcess();
+ assertEquals(0, processInfo.waitFor());
}
assertTrue(foundFile);
}
log.trace("invalidate cached file handles by issuing a compaction");
- accumuloClient.tableOperations().online(tableName, true);
- accumuloClient.tableOperations().compact(tableName, null, null, false, true);
+ client.tableOperations().online(tableName, true);
+ client.tableOperations().compact(tableName, null, null, false, true);
log.debug("make sure we can still scan");
- try (Scanner scan = accumuloClient.createScanner(tableName, Authorizations.EMPTY)) {
+ try (Scanner scan = client.createScanner(tableName, Authorizations.EMPTY)) {
scan.setRange(new Range());
long cells = 0L;
for (Entry<Key,Value> entry : scan) {
@@ -110,5 +114,4 @@ public class RecoveryWithEmptyRFileIT extends ConfigurableMacBase {
}
}
}
-
}
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/RegexGroupBalanceIT.java b/test/src/main/java/org/apache/accumulo/test/functional/RegexGroupBalanceIT.java
index e93a89d..0050c25 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/RegexGroupBalanceIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/RegexGroupBalanceIT.java
@@ -24,6 +24,7 @@ import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -53,7 +54,7 @@ public class RegexGroupBalanceIT extends ConfigurableMacBase {
@Test(timeout = 120000)
public void testBalancing() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String tablename = getUniqueNames(1)[0];
client.tableOperations().create(tablename);
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SessionDurabilityIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SessionDurabilityIT.java
index 7f3b78b..bcc8c80 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SessionDurabilityIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SessionDurabilityIT.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.test.functional;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -51,7 +52,7 @@ public class SessionDurabilityIT extends ConfigurableMacBase {
@Test(timeout = 3 * 60 * 1000)
public void nondurableTableHasDurableWrites() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
// table default has no durability
c.tableOperations().create(tableName);
@@ -69,7 +70,7 @@ public class SessionDurabilityIT extends ConfigurableMacBase {
@Test(timeout = 3 * 60 * 1000)
public void durableTableLosesNonDurableWrites() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
// table default is durable writes
c.tableOperations().create(tableName);
@@ -101,7 +102,7 @@ public class SessionDurabilityIT extends ConfigurableMacBase {
@Test(timeout = 3 * 60 * 1000)
public void testConditionDurability() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
// table default is durable writes
c.tableOperations().create(tableName);
@@ -120,7 +121,7 @@ public class SessionDurabilityIT extends ConfigurableMacBase {
@Test(timeout = 3 * 60 * 1000)
public void testConditionDurability2() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
// table default is durable writes
c.tableOperations().create(tableName);
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ShutdownIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ShutdownIT.java
index 6db093a..b40325c 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ShutdownIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ShutdownIT.java
@@ -25,6 +25,7 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.miniclusterImpl.MiniAccumuloClusterImpl;
import org.apache.accumulo.server.util.Admin;
@@ -75,7 +76,7 @@ public class ShutdownIT extends ConfigurableMacBase {
@Test
public void shutdownDuringDeleteTable() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
for (int i = 0; i < 10; i++) {
c.tableOperations().create("table" + i);
}
@@ -103,7 +104,7 @@ public class ShutdownIT extends ConfigurableMacBase {
@Test
public void adminStop() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
runAdminStopTest(c, cluster);
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SimpleBalancerFairnessIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SimpleBalancerFairnessIT.java
index 97f3b37..4f8a421 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SimpleBalancerFairnessIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SimpleBalancerFairnessIT.java
@@ -25,6 +25,7 @@ import java.util.List;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.clientImpl.ClientContext;
@@ -62,7 +63,7 @@ public class SimpleBalancerFairnessIT extends ConfigurableMacBase {
@Test
public void simpleBalancerFairness() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
c.tableOperations().create("test_ingest");
c.tableOperations().setProperty("test_ingest", Property.TABLE_SPLIT_THRESHOLD.getKey(),
"10K");
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SslIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SslIT.java
index aa17e75..dfb4f33 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SslIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SslIT.java
@@ -16,7 +16,11 @@
*/
package org.apache.accumulo.test.functional;
+import java.util.Properties;
+
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
+import org.apache.accumulo.core.clientImpl.ClientInfo;
import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
@@ -42,7 +46,7 @@ public class SslIT extends ConfigurableMacBase {
@Test
public void binary() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
client.tableOperations().create(tableName);
BinaryIT.runTest(client, tableName);
@@ -51,22 +55,23 @@ public class SslIT extends ConfigurableMacBase {
@Test
public void concurrency() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
ConcurrencyIT.runTest(client, getUniqueNames(1)[0]);
}
}
@Test
public void adminStop() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
ShutdownIT.runAdminStopTest(client, getCluster());
}
}
@Test
public void bulk() throws Exception {
- try (AccumuloClient client = createClient()) {
- BulkIT.runTest(client, getClientInfo(), cluster.getFileSystem(),
+ Properties props = getClientProperties();
+ try (AccumuloClient client = Accumulo.newClient().from(props).build()) {
+ BulkIT.runTest(client, ClientInfo.from(props), cluster.getFileSystem(),
new Path(getCluster().getConfig().getDir().getAbsolutePath(), "tmp"),
getUniqueNames(1)[0], this.getClass().getName(), testName.getMethodName(), true);
}
@@ -75,7 +80,7 @@ public class SslIT extends ConfigurableMacBase {
@SuppressWarnings("deprecation")
@Test
public void mapReduce() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
// testing old mapreduce code from core jar; the new mapreduce module should have its own test
// case which checks functionality with ssl enabled
org.apache.accumulo.test.mapreduce.MapReduceIT.runTest(client, getCluster());
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java b/test/src/main/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
index 7a56323..15bf746 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
@@ -40,6 +40,7 @@ import java.util.Map.Entry;
import java.util.Random;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -98,7 +99,7 @@ public class WALSunnyDayIT extends ConfigurableMacBase {
MiniAccumuloClusterControl control = mac.getClusterControl();
control.stop(GARBAGE_COLLECTOR);
ServerContext context = getServerContext();
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
writeSomeData(c, tableName, 1, 1);
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java b/test/src/main/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java
index b7e4906..ef1d701 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java
@@ -19,8 +19,11 @@ package org.apache.accumulo.test.functional;
import static org.junit.Assert.assertTrue;
import java.net.Socket;
+import java.util.Properties;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
+import org.apache.accumulo.core.conf.ClientProperty;
import org.apache.accumulo.core.util.HostAndPort;
import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
import org.apache.hadoop.conf.Configuration;
@@ -47,13 +50,14 @@ public class WatchTheWatchCountIT extends ConfigurableMacBase {
justification = "unencrypted socket is okay for testing")
@Test
public void test() throws Exception {
- try (AccumuloClient c = createClient()) {
+ Properties props = getClientProperties();
+ try (AccumuloClient c = Accumulo.newClient().from(props).build()) {
String[] tableNames = getUniqueNames(3);
for (String tableName : tableNames) {
c.tableOperations().create(tableName);
}
c.tableOperations().list();
- String zooKeepers = getClientInfo().getZooKeepers();
+ String zooKeepers = ClientProperty.INSTANCE_ZOOKEEPERS.getValue(props);
final long MIN = 475L;
final long MAX = 700L;
long total = 0;
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ZooCacheIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ZooCacheIT.java
index ee89fc2..e4b884d 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ZooCacheIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ZooCacheIT.java
@@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.clientImpl.ClientInfo;
import org.apache.commons.io.FileUtils;
@@ -57,7 +58,7 @@ public class ZooCacheIT extends ConfigurableMacBase {
List<Thread> threads = new ArrayList<>();
for (int i = 0; i < 3; i++) {
Thread reader = new Thread(() -> {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
CacheTestReader.main(new String[] {pathName, testDir.getAbsolutePath(),
ClientInfo.from(client.properties()).getZooKeepers()});
} catch (Exception ex) {
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java
index 41d4189..ad9a786 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java
@@ -27,6 +27,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -59,7 +60,7 @@ public class ZookeeperRestartIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
c.tableOperations().create("test_ingest");
try (BatchWriter bw = c.createBatchWriter("test_ingest")) {
Mutation m = new Mutation("row");
diff --git a/test/src/main/java/org/apache/accumulo/test/gc/replication/CloseWriteAheadLogReferencesIT.java b/test/src/main/java/org/apache/accumulo/test/gc/replication/CloseWriteAheadLogReferencesIT.java
index ef30e86..af1ef19 100644
--- a/test/src/main/java/org/apache/accumulo/test/gc/replication/CloseWriteAheadLogReferencesIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/gc/replication/CloseWriteAheadLogReferencesIT.java
@@ -29,6 +29,7 @@ import java.util.Properties;
import java.util.Set;
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.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -80,7 +81,7 @@ public class CloseWriteAheadLogReferencesIT extends ConfigurableMacBase {
@Before
public void setupInstance() throws Exception {
- client = createClient();
+ client = Accumulo.newClient().from(getClientProperties()).build();
client.securityOperations().grantTablePermission(client.whoami(), ReplicationTable.NAME,
TablePermission.WRITE);
client.securityOperations().grantTablePermission(client.whoami(), MetadataTable.NAME,
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 3e64643..4f46083 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
@@ -27,6 +27,7 @@ import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map.Entry;
+import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.Accumulo;
@@ -72,9 +73,10 @@ public class AccumuloOutputFormatIT extends ConfigurableMacBase {
// Prevent regression of ACCUMULO-3709.
@Test
public void testMapred() throws Exception {
- try (AccumuloClient accumuloClient = createClient()) {
+ Properties props = getClientProperties();
+ try (AccumuloClient client = Accumulo.newClient().from(props).build()) {
// create a table and put some data in it
- accumuloClient.tableOperations().create(testName.getMethodName());
+ client.tableOperations().create(testName.getMethodName());
JobConf job = new JobConf();
BatchWriterConfig batchConfig = new BatchWriterConfig();
@@ -85,7 +87,7 @@ public class AccumuloOutputFormatIT extends ConfigurableMacBase {
// set the max memory so that we ensure we don't flush on the write.
batchConfig.setMaxMemory(Long.MAX_VALUE);
org.apache.accumulo.core.client.mapred.AccumuloOutputFormat outputFormat = new org.apache.accumulo.core.client.mapred.AccumuloOutputFormat();
- ClientInfo ci = getClientInfo();
+ ClientInfo ci = ClientInfo.from(props);
org.apache.accumulo.core.client.mapred.AccumuloOutputFormat.setZooKeeperInstance(job,
ci.getInstanceName(), ci.getZooKeepers());
org.apache.accumulo.core.client.mapred.AccumuloOutputFormat.setConnectorInfo(job,
@@ -108,7 +110,7 @@ public class AccumuloOutputFormatIT extends ConfigurableMacBase {
// we don't want the exception to come from write
}
- accumuloClient.securityOperations().revokeTablePermission("root", testName.getMethodName(),
+ client.securityOperations().revokeTablePermission("root", testName.getMethodName(),
TablePermission.WRITE);
try {
@@ -215,7 +217,7 @@ public class AccumuloOutputFormatIT extends ConfigurableMacBase {
@Test
public void testMR() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String instanceName = getCluster().getInstanceName();
String table1 = instanceName + "_t1";
String table2 = instanceName + "_t2";
diff --git a/test/src/main/java/org/apache/accumulo/test/mapreduce/MapReduceIT.java b/test/src/main/java/org/apache/accumulo/test/mapreduce/MapReduceIT.java
index e49ac7e..1b489a5 100644
--- a/test/src/main/java/org/apache/accumulo/test/mapreduce/MapReduceIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/mapreduce/MapReduceIT.java
@@ -25,6 +25,7 @@ import java.util.Base64;
import java.util.Collections;
import java.util.Map.Entry;
+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;
@@ -68,7 +69,7 @@ public class MapReduceIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
runTest(client, getCluster());
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/mapreduce/RowHash.java b/test/src/main/java/org/apache/accumulo/test/mapreduce/RowHash.java
index fc027e1..fa308ba 100644
--- a/test/src/main/java/org/apache/accumulo/test/mapreduce/RowHash.java
+++ b/test/src/main/java/org/apache/accumulo/test/mapreduce/RowHash.java
@@ -21,17 +21,12 @@ import java.util.Base64;
import java.util.Collections;
import org.apache.accumulo.core.cli.ClientOpts;
-import org.apache.accumulo.core.client.Accumulo;
-import org.apache.accumulo.core.client.AccumuloClient;
-import org.apache.accumulo.core.client.admin.DelegationTokenConfig;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
-import org.apache.accumulo.core.client.security.tokens.KerberosToken;
import org.apache.accumulo.core.clientImpl.ClientConfConverter;
import org.apache.accumulo.core.conf.ClientProperty;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.security.SystemPermission;
import org.apache.accumulo.core.util.Pair;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
@@ -39,11 +34,8 @@ import org.apache.hadoop.io.MD5Hash;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
-import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import com.beust.jcommander.Parameter;
@@ -97,8 +89,8 @@ public class RowHash extends Configured implements Tool {
AuthenticationToken token = opts.getToken();
org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat.setConnectorInfo(job, principal,
token);
- org.apache.accumulo.core.client.mapreduce.AccumuloOutputFormat.setConnectorInfo(job,
- principal, token);
+ org.apache.accumulo.core.client.mapreduce.AccumuloOutputFormat.setConnectorInfo(job, principal,
+ token);
org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat.setInputTableName(job,
opts.tableName);
org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat.setScanAuthorizations(job,
diff --git a/test/src/main/java/org/apache/accumulo/test/master/MergeStateIT.java b/test/src/main/java/org/apache/accumulo/test/master/MergeStateIT.java
index 7027d87..89b407d 100644
--- a/test/src/main/java/org/apache/accumulo/test/master/MergeStateIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/master/MergeStateIT.java
@@ -22,6 +22,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Set;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchDeleter;
import org.apache.accumulo.core.client.BatchWriter;
@@ -106,7 +107,7 @@ public class MergeStateIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
ServerContext context = getServerContext();
- try (AccumuloClient accumuloClient = createClient()) {
+ try (AccumuloClient accumuloClient = Accumulo.newClient().from(getClientProperties()).build()) {
accumuloClient.securityOperations().grantTablePermission(accumuloClient.whoami(),
MetadataTable.NAME, TablePermission.WRITE);
BatchWriter bw = accumuloClient.createBatchWriter(MetadataTable.NAME,
diff --git a/test/src/main/java/org/apache/accumulo/test/master/SuspendedTabletsIT.java b/test/src/main/java/org/apache/accumulo/test/master/SuspendedTabletsIT.java
index 37aa077..90711d4 100644
--- a/test/src/main/java/org/apache/accumulo/test/master/SuspendedTabletsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/master/SuspendedTabletsIT.java
@@ -42,6 +42,7 @@ import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.clientImpl.MasterClient;
@@ -164,7 +165,7 @@ public class SuspendedTabletsIT extends ConfigurableMacBase {
* callback which shuts down some tablet servers.
*/
private void suspensionTestBody(TServerKiller serverStopper) throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
ClientContext ctx = (ClientContext) client;
String tableName = getUniqueNames(1)[0];
diff --git a/test/src/main/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java b/test/src/main/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java
index f1981cb..9d6d41e 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java
@@ -22,6 +22,7 @@ import static org.junit.Assume.assumeFalse;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.metadata.MetadataTable;
@@ -102,7 +103,7 @@ public class RollWALPerformanceIT extends ConfigurableMacBase {
@Test
public void testWalPerformanceOnce() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
// get time with a small WAL, which will cause many WAL roll-overs
long avg1 = getAverage(c);
// use a bigger WAL max size to eliminate WAL roll-overs
diff --git a/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java b/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java
index 3b25622..dbb56d8 100644
--- a/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java
@@ -30,6 +30,7 @@ import java.util.Properties;
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.ClientProperty;
@@ -84,13 +85,13 @@ public class ProxyDurabilityIT extends ConfigurableMacBase {
@SuppressFBWarnings(value = "HARD_CODE_PASSWORD", justification = "test password is okay")
@Test
public void testDurability() throws Exception {
- try (AccumuloClient c = createClient()) {
+ try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
Properties proxyProps = new Properties();
// Avoid issues with locally installed client configuration files with custom properties
File emptyFile = Files.createTempFile(null, null).toFile();
emptyFile.deleteOnExit();
proxyProps.put("tokenClass", PasswordToken.class.getName());
- proxyProps.putAll(getClientInfo().getProperties());
+ proxyProps.putAll(getClientProperties());
TJSONProtocol.Factory protocol = new TJSONProtocol.Factory();
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/FinishedWorkUpdaterIT.java b/test/src/main/java/org/apache/accumulo/test/replication/FinishedWorkUpdaterIT.java
index 08fdf36..86ceae2 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/FinishedWorkUpdaterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/FinishedWorkUpdaterIT.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertEquals;
import java.util.Map.Entry;
import java.util.UUID;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -50,7 +51,7 @@ public class FinishedWorkUpdaterIT extends ConfigurableMacBase {
@Before
public void configureUpdater() {
- client = createClient();
+ client = Accumulo.newClient().from(getClientProperties()).build();
updater = new FinishedWorkUpdater(client);
}
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java b/test/src/main/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java
index ae86027..71a629c 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java
@@ -30,6 +30,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -124,7 +125,7 @@ public class GarbageCollectorCommunicatesWithTServersIT extends ConfigurableMacB
* Fetch all of the rfiles referenced by tablets in the metadata table for this table
*/
private Set<String> getFilesForTable(String tableName) throws Exception {
- final AccumuloClient client = createClient();
+ final AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build();
final TableId tableId = TableId.of(client.tableOperations().tableIdMap().get(tableName));
assertNotNull("Could not determine table ID for " + tableName, tableId);
@@ -152,7 +153,7 @@ public class GarbageCollectorCommunicatesWithTServersIT extends ConfigurableMacB
* entries)
*/
private Map<String,Status> getMetadataStatusForTable(String tableName) throws Exception {
- final AccumuloClient client = createClient();
+ final AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build();
final String tableId = client.tableOperations().tableIdMap().get(tableName);
assertNotNull("Could not determine table ID for " + tableName, tableId);
@@ -177,7 +178,7 @@ public class GarbageCollectorCommunicatesWithTServersIT extends ConfigurableMacB
@Test
public void testActiveWalPrecludesClosing() throws Exception {
final String table = getUniqueNames(1)[0];
- final AccumuloClient client = createClient();
+ final AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build();
// Bring the replication table online first and foremost
ReplicationTable.setOnline(client);
@@ -269,7 +270,7 @@ public class GarbageCollectorCommunicatesWithTServersIT extends ConfigurableMacB
final String[] names = getUniqueNames(2);
// `table` will be replicated, `otherTable` is only used to roll the WAL on the tserver
final String table = names[0], otherTable = names[1];
- final AccumuloClient client = createClient();
+ final AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build();
// Bring the replication table online first and foremost
ReplicationTable.setOnline(client);
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java b/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
index e1ae809..8550875 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
@@ -35,6 +35,7 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -175,7 +176,7 @@ public class MultiInstanceReplicationIT extends ConfigurableMacBase {
peerCluster.start();
- try (AccumuloClient clientMaster = createClient();
+ try (AccumuloClient clientMaster = Accumulo.newClient().from(getClientProperties()).build();
AccumuloClient clientPeer = peerCluster.createAccumuloClient("root",
new PasswordToken(ROOT_PASSWORD))) {
@@ -349,7 +350,7 @@ public class MultiInstanceReplicationIT extends ConfigurableMacBase {
peer1Cluster.start();
- try (AccumuloClient clientMaster = createClient();
+ try (AccumuloClient clientMaster = Accumulo.newClient().from(getClientProperties()).build();
AccumuloClient clientPeer = peer1Cluster.createAccumuloClient("root",
new PasswordToken(ROOT_PASSWORD))) {
String peerClusterName = "peer";
@@ -509,7 +510,7 @@ public class MultiInstanceReplicationIT extends ConfigurableMacBase {
peerCluster.start();
- try (AccumuloClient clientMaster = createClient();
+ try (AccumuloClient clientMaster = Accumulo.newClient().from(getClientProperties()).build();
AccumuloClient clientPeer = peerCluster.createAccumuloClient("root",
new PasswordToken(ROOT_PASSWORD))) {
@@ -629,7 +630,7 @@ public class MultiInstanceReplicationIT extends ConfigurableMacBase {
peer1Cluster.start();
- try (AccumuloClient clientMaster = createClient();
+ try (AccumuloClient clientMaster = Accumulo.newClient().from(getClientProperties()).build();
AccumuloClient clientPeer = peer1Cluster.createAccumuloClient("root",
new PasswordToken(ROOT_PASSWORD))) {
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/MultiTserverReplicationIT.java b/test/src/main/java/org/apache/accumulo/test/replication/MultiTserverReplicationIT.java
index 7916d98..b78c097 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/MultiTserverReplicationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/MultiTserverReplicationIT.java
@@ -25,6 +25,7 @@ import java.util.HashSet;
import java.util.Set;
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.Scanner;
import org.apache.accumulo.core.clientImpl.ClientContext;
@@ -56,7 +57,7 @@ public class MultiTserverReplicationIT extends ConfigurableMacBase {
@Test
public void tserverReplicationServicePortsAreAdvertised() throws Exception {
// Wait for the cluster to be up
- AccumuloClient client = createClient();
+ AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build();
ClientContext context = (ClientContext) client;
// Wait for a tserver to come up to fulfill this request
@@ -94,7 +95,7 @@ public class MultiTserverReplicationIT extends ConfigurableMacBase {
@Test
public void masterReplicationServicePortsAreAdvertised() throws Exception {
// Wait for the cluster to be up
- AccumuloClient client = createClient();
+ AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build();
ClientContext context = (ClientContext) client;
// Wait for a tserver to come up to fulfill this request
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/RemoveCompleteReplicationRecordsIT.java b/test/src/main/java/org/apache/accumulo/test/replication/RemoveCompleteReplicationRecordsIT.java
index 9155caa..4fd141b 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/RemoveCompleteReplicationRecordsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/RemoveCompleteReplicationRecordsIT.java
@@ -25,6 +25,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
@@ -73,7 +74,7 @@ public class RemoveCompleteReplicationRecordsIT extends ConfigurableMacBase {
@Before
public void initialize() throws Exception {
- client = createClient();
+ client = Accumulo.newClient().from(getClientProperties()).build();
rcrr = new MockRemoveCompleteReplicationRecords(client);
client.securityOperations().grantTablePermission(client.whoami(), ReplicationTable.NAME,
TablePermission.READ);
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/ReplicationIT.java b/test/src/main/java/org/apache/accumulo/test/replication/ReplicationIT.java
index 053370c..9aebdae 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/ReplicationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/ReplicationIT.java
@@ -41,6 +41,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
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;
@@ -215,7 +216,7 @@ public class ReplicationIT extends ConfigurableMacBase {
@Test
public void replicationTableCreated() {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
assertTrue(client.tableOperations().exists(ReplicationTable.NAME));
assertEquals(ReplicationTable.ID.canonical(),
client.tableOperations().tableIdMap().get(ReplicationTable.NAME));
@@ -225,7 +226,7 @@ public class ReplicationIT extends ConfigurableMacBase {
@Test
public void verifyReplicationTableConfig()
throws AccumuloException, TableNotFoundException, AccumuloSecurityException {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
TableOperations tops = client.tableOperations();
Map<String,EnumSet<IteratorScope>> iterators = tops.listIterators(ReplicationTable.NAME);
@@ -294,7 +295,7 @@ public class ReplicationIT extends ConfigurableMacBase {
@Test
public void correctRecordsCompleteFile() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String table = "table1";
client.tableOperations().create(table);
// If we have more than one tserver, this is subject to a race condition.
@@ -370,7 +371,7 @@ public class ReplicationIT extends ConfigurableMacBase {
@Test
public void noRecordsWithoutReplication() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
List<String> tables = new ArrayList<>();
// replication shouldn't be online when we begin
@@ -410,7 +411,7 @@ public class ReplicationIT extends ConfigurableMacBase {
@Test
public void twoEntriesForTwoTables() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String table1 = "table1", table2 = "table2";
// replication shouldn't exist when we begin
@@ -542,7 +543,7 @@ public class ReplicationIT extends ConfigurableMacBase {
@Test
public void replicationEntriesPrecludeWalDeletion() throws Exception {
final ServerContext context = getServerContext();
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String table1 = "table1", table2 = "table2", table3 = "table3";
final Multimap<String,TableId> logs = HashMultimap.create();
final AtomicBoolean keepRunning = new AtomicBoolean(true);
@@ -657,7 +658,7 @@ public class ReplicationIT extends ConfigurableMacBase {
@Test
public void combinerWorksOnMetadata() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
client.securityOperations().grantTablePermission("root", MetadataTable.NAME,
TablePermission.WRITE);
@@ -703,7 +704,7 @@ public class ReplicationIT extends ConfigurableMacBase {
@Test
public void noDeadlock() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
ReplicationTable.setOnline(client);
client.securityOperations().grantTablePermission("root", ReplicationTable.NAME,
@@ -748,7 +749,7 @@ public class ReplicationIT extends ConfigurableMacBase {
@Test
public void filesClosedAfterUnused() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String table = "table";
client.tableOperations().create(table);
@@ -865,7 +866,7 @@ public class ReplicationIT extends ConfigurableMacBase {
// against expected Status messages.
getCluster().getClusterControl().stop(ServerType.GARBAGE_COLLECTOR);
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String table1 = "table1";
// replication shouldn't be online when we begin
@@ -1037,7 +1038,7 @@ public class ReplicationIT extends ConfigurableMacBase {
@Test
public void correctClusterNameInWorkEntry() throws Exception {
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String table1 = "table1";
// replication shouldn't be online when we begin
@@ -1122,7 +1123,7 @@ public class ReplicationIT extends ConfigurableMacBase {
getCluster().getClusterControl().stop(ServerType.GARBAGE_COLLECTOR);
final ServerContext context = getServerContext();
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
ReplicationTable.setOnline(client);
client.securityOperations().grantTablePermission("root", ReplicationTable.NAME,
@@ -1300,7 +1301,7 @@ public class ReplicationIT extends ConfigurableMacBase {
// Just stop it now, we'll restart it after we restart the tserver
getCluster().getClusterControl().stop(ServerType.GARBAGE_COLLECTOR);
- try (AccumuloClient client = createClient()) {
+ try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
log.info("Got client to MAC");
String table1 = "table1";
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/ReplicationOperationsImplIT.java b/test/src/main/java/org/apache/accumulo/test/replication/ReplicationOperationsImplIT.java
index 7151783..8cae0b0 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/ReplicationOperationsImplIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/ReplicationOperationsImplIT.java
@@ -25,6 +25,7 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -66,7 +67,7 @@ public class ReplicationOperationsImplIT extends ConfigurableMacBase {
@Before
public void configureInstance() throws Exception {
- client = createClient();
+ client = Accumulo.newClient().from(getClientProperties()).build();
serverContext = getServerContext();
ReplicationTable.setOnline(client);
client.securityOperations().grantTablePermission(client.whoami(), MetadataTable.NAME,
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/SequentialWorkAssignerIT.java b/test/src/main/java/org/apache/accumulo/test/replication/SequentialWorkAssignerIT.java
index fd7bac7..bc2a446 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/SequentialWorkAssignerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/SequentialWorkAssignerIT.java
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import java.util.Map;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.data.Mutation;
@@ -96,7 +97,7 @@ public class SequentialWorkAssignerIT extends ConfigurableMacBase {
@Before
public void init() throws Exception {
- client = createClient();
+ client = Accumulo.newClient().from(getClientProperties()).build();
assigner = new MockSequentialWorkAssigner(client);
// grant ourselves write to the replication table
client.securityOperations().grantTablePermission(client.whoami(), ReplicationTable.NAME,
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/StatusMakerIT.java b/test/src/main/java/org/apache/accumulo/test/replication/StatusMakerIT.java
index 530d7b9..848db67 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/StatusMakerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/StatusMakerIT.java
@@ -31,6 +31,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -69,7 +70,7 @@ public class StatusMakerIT extends ConfigurableMacBase {
@Before
public void setupInstance() throws Exception {
- client = createClient();
+ client = Accumulo.newClient().from(getClientProperties()).build();
ReplicationTable.setOnline(client);
client.securityOperations().grantTablePermission(client.whoami(), ReplicationTable.NAME,
TablePermission.WRITE);
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerIT.java b/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerIT.java
index cc561c2..513d1b8 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerIT.java
@@ -25,6 +25,7 @@ import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.data.Mutation;
@@ -110,7 +111,7 @@ public class UnorderedWorkAssignerIT extends ConfigurableMacBase {
@Before
public void init() throws Exception {
- client = createClient();
+ client = Accumulo.newClient().from(getClientProperties()).build();
assigner = new MockUnorderedWorkAssigner(client);
ReplicationTable.setOnline(client);
client.securityOperations().grantTablePermission(client.whoami(), ReplicationTable.NAME,
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java b/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
index 1ad2e9c..25bd866 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
@@ -35,6 +35,7 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -180,7 +181,7 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacBase {
peerCluster.start();
- try (AccumuloClient clientMaster = createClient();
+ try (AccumuloClient clientMaster = Accumulo.newClient().from(getClientProperties()).build();
AccumuloClient clientPeer = peerCluster.createAccumuloClient("root",
new PasswordToken(ROOT_PASSWORD))) {
@@ -345,7 +346,7 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacBase {
peer1Cluster.start();
- try (AccumuloClient clientMaster = createClient();
+ try (AccumuloClient clientMaster = Accumulo.newClient().from(getClientProperties()).build();
AccumuloClient clientPeer = peer1Cluster.createAccumuloClient("root",
new PasswordToken(ROOT_PASSWORD))) {
@@ -520,7 +521,7 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacBase {
peerCluster.start();
- try (AccumuloClient clientMaster = createClient();
+ try (AccumuloClient clientMaster = Accumulo.newClient().from(getClientProperties()).build();
AccumuloClient clientPeer = peerCluster.createAccumuloClient("root",
new PasswordToken(ROOT_PASSWORD))) {
@@ -636,7 +637,7 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacBase {
peer1Cluster.start();
- try (AccumuloClient clientMaster = createClient();
+ try (AccumuloClient clientMaster = Accumulo.newClient().from(getClientProperties()).build();
AccumuloClient clientPeer = peer1Cluster.createAccumuloClient("root",
new PasswordToken(ROOT_PASSWORD))) {
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java b/test/src/main/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
index c6914ce..2564e90 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
@@ -29,6 +29,7 @@ import java.util.Collections;
import java.util.Map.Entry;
import java.util.UUID;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -74,7 +75,7 @@ public class UnusedWalDoesntCloseReplicationStatusIT extends ConfigurableMacBase
@Test
public void test() throws Exception {
File accumuloDir = this.getCluster().getConfig().getAccumuloDir();
- final AccumuloClient client = createClient();
+ final AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build();
final String tableName = getUniqueNames(1)[0];
client.securityOperations().grantTablePermission("root", MetadataTable.NAME,
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/WorkMakerIT.java b/test/src/main/java/org/apache/accumulo/test/replication/WorkMakerIT.java
index 3a04b19..f3988df 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/WorkMakerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/WorkMakerIT.java
@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Scanner;
@@ -79,7 +80,7 @@ public class WorkMakerIT extends ConfigurableMacBase {
@Before
public void setupInstance() throws Exception {
- client = createClient();
+ client = Accumulo.newClient().from(getClientProperties()).build();
ReplicationTable.setOnline(client);
client.securityOperations().grantTablePermission(client.whoami(), ReplicationTable.NAME,
TablePermission.WRITE);