accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwa...@apache.org
Subject [accumulo] branch master updated: Move AccumuloClient.getInstanceID to InstanceOperations (#926)
Date Thu, 07 Feb 2019 17:37:28 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 27ca87b  Move AccumuloClient.getInstanceID to InstanceOperations (#926)
27ca87b is described below

commit 27ca87b1e48f607a8e38c9d996fef613d3803e1f
Author: Jeffrey Zeiberg <jzeiberg@gmail.com>
AuthorDate: Thu Feb 7 12:37:23 2019 -0500

    Move AccumuloClient.getInstanceID to InstanceOperations (#926)
---
 .../org/apache/accumulo/core/client/AccumuloClient.java  |  7 -------
 .../accumulo/core/client/admin/InstanceOperations.java   |  8 ++++++++
 .../apache/accumulo/core/clientImpl/ClientContext.java   |  1 -
 .../accumulo/core/clientImpl/InstanceOperationsImpl.java |  6 ++++++
 .../replication/DistributedWorkQueueWorkAssigner.java    |  4 +++-
 .../master/replication/SequentialWorkAssigner.java       |  2 +-
 .../master/replication/UnorderedWorkAssigner.java        |  2 +-
 .../org/apache/accumulo/master/state/MergeStats.java     |  4 ++--
 .../master/replication/SequentialWorkAssignerTest.java   |  7 +++++--
 .../master/replication/UnorderedWorkAssignerTest.java    |  8 ++++++--
 shell/src/main/java/org/apache/accumulo/shell/Shell.java |  2 +-
 .../apache/accumulo/test/BadDeleteMarkersCreatedIT.java  |  3 ++-
 .../java/org/apache/accumulo/test/ExistingMacIT.java     |  3 ++-
 .../test/ThriftServerBindsBeforeZooKeeperLockIT.java     |  4 ++--
 .../src/main/java/org/apache/accumulo/test/VolumeIT.java |  8 +++++---
 .../accumulo/test/functional/AccumuloClientIT.java       |  2 +-
 .../apache/accumulo/test/functional/BackupMasterIT.java  |  2 +-
 .../functional/BalanceInPresenceOfOfflineTableIT.java    |  2 +-
 .../accumulo/test/functional/DynamicThreadPoolsIT.java   |  3 ++-
 .../accumulo/test/functional/GarbageCollectorIT.java     |  3 ++-
 .../org/apache/accumulo/test/functional/ReadWriteIT.java |  4 +++-
 .../org/apache/accumulo/test/functional/RestartIT.java   |  6 +++---
 .../test/functional/SimpleBalancerFairnessIT.java        |  3 ++-
 .../accumulo/test/functional/TableChangeStateIT.java     |  6 ++++--
 .../test/functional/TabletStateChangeIteratorIT.java     |  4 ++--
 .../test/replication/MultiTserverReplicationIT.java      | 16 +++++++++-------
 .../apache/accumulo/test/replication/ReplicationIT.java  |  3 ++-
 27 files changed, 76 insertions(+), 47 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java b/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java
index d3cde65..d23b1e6 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java
@@ -265,13 +265,6 @@ public interface AccumuloClient extends AutoCloseable {
   String whoami();
 
   /**
-   * Returns a unique string that identifies this instance of accumulo.
-   *
-   * @return a UUID
-   */
-  String getInstanceID();
-
-  /**
    * Retrieves a TableOperations object to perform table functions, such as create and delete.
    *
    * @return an object to manipulate tables
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
b/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
index b9be310..d17b9d7 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
@@ -130,4 +130,12 @@ public interface InstanceOperations {
    * @since 1.7.0
    */
   void waitForBalance() throws AccumuloException;
+
+  /**
+   * Returns a unique string that identifies this instance of accumulo.
+   *
+   * @return a String
+   * @since 2.0.0
+   */
+  String getInstanceID();
 }
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java
index 6d65fd9..6294e6c 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java
@@ -387,7 +387,6 @@ public class ClientContext implements AccumuloClient {
    *
    * @return a UUID
    */
-  @Override
   public String getInstanceID() {
     ensureOpen();
     final String instanceName = info.getInstanceName();
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java
b/core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java
index 5813f27..4713578 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java
@@ -232,4 +232,10 @@ public class InstanceOperationsImpl implements InstanceOperations {
     }
     return null;
   }
+
+  @Override
+  public String getInstanceID() {
+
+    return context.getInstanceID();
+  }
 }
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java
b/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java
index dab030e..115b76c 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java
@@ -88,7 +88,9 @@ public abstract class DistributedWorkQueueWorkAssigner implements WorkAssigner
{
    */
   protected void initializeWorkQueue(AccumuloConfiguration conf) {
     workQueue = new DistributedWorkQueue(
-        ZooUtil.getRoot(client.getInstanceID()) + ReplicationConstants.ZOO_WORK_QUEUE, conf);
+        ZooUtil.getRoot(client.instanceOperations().getInstanceID())
+            + ReplicationConstants.ZOO_WORK_QUEUE,
+        conf);
   }
 
   @Override
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/SequentialWorkAssigner.java
b/server/master/src/main/java/org/apache/accumulo/master/replication/SequentialWorkAssigner.java
index 323688f..8210847 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/SequentialWorkAssigner.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/SequentialWorkAssigner.java
@@ -119,7 +119,7 @@ public class SequentialWorkAssigner extends DistributedWorkQueueWorkAssigner
{
   protected void cleanupFinishedWork() {
     final Iterator<Entry<String,Map<Table.ID,String>>> queuedWork = queuedWorkByPeerName.entrySet()
         .iterator();
-    final String instanceId = client.getInstanceID();
+    final String instanceId = client.instanceOperations().getInstanceID();
 
     int elementsRemoved = 0;
     // Check the status of all the work we've queued up
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java
b/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java
index a1cb36e..06a5e8a 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java
@@ -137,7 +137,7 @@ public class UnorderedWorkAssigner extends DistributedWorkQueueWorkAssigner
{
   @Override
   protected void cleanupFinishedWork() {
     final Iterator<String> work = queuedWork.iterator();
-    final String instanceId = client.getInstanceID();
+    final String instanceId = client.instanceOperations().getInstanceID();
     while (work.hasNext()) {
       String filename = work.next();
       // Null equates to the work was finished
diff --git a/server/master/src/main/java/org/apache/accumulo/master/state/MergeStats.java
b/server/master/src/main/java/org/apache/accumulo/master/state/MergeStats.java
index b79f6c4..e5cda40 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/state/MergeStats.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/state/MergeStats.java
@@ -267,8 +267,8 @@ public class MergeStats {
       ZooReaderWriter zooReaderWriter = opts.getServerContext().getZooReaderWriter();
       for (Entry<String,String> entry : tableIdMap.entrySet()) {
         final String table = entry.getKey(), tableId = entry.getValue();
-        String path = ZooUtil.getRoot(client.getInstanceID()) + Constants.ZTABLES + "/" +
tableId
-            + "/merge";
+        String path = ZooUtil.getRoot(client.instanceOperations().getInstanceID())
+            + Constants.ZTABLES + "/" + tableId + "/merge";
         MergeInfo info = new MergeInfo();
         if (zooReaderWriter.exists(path)) {
           byte[] data = zooReaderWriter.getData(path, new Stat());
diff --git a/server/master/src/test/java/org/apache/accumulo/master/replication/SequentialWorkAssignerTest.java
b/server/master/src/test/java/org/apache/accumulo/master/replication/SequentialWorkAssignerTest.java
index 8e6df6a..dacd273 100644
--- a/server/master/src/test/java/org/apache/accumulo/master/replication/SequentialWorkAssignerTest.java
+++ b/server/master/src/test/java/org/apache/accumulo/master/replication/SequentialWorkAssignerTest.java
@@ -26,6 +26,7 @@ import java.util.Map;
 import java.util.TreeMap;
 
 import org.apache.accumulo.core.client.AccumuloClient;
+import org.apache.accumulo.core.client.admin.InstanceOperations;
 import org.apache.accumulo.core.clientImpl.Table;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.replication.ReplicationConstants;
@@ -71,7 +72,9 @@ public class SequentialWorkAssignerTest {
     assigner.setWorkQueue(workQueue);
     assigner.setQueuedWork(queuedWork);
 
-    expect(client.getInstanceID()).andReturn("instance");
+    InstanceOperations opts = createMock(InstanceOperations.class);
+    expect(opts.getInstanceID()).andReturn("instance");
+    expect(client.instanceOperations()).andReturn(opts);
 
     // file1 replicated
     expect(zooCache.get(ZooUtil.getRoot("instance") + ReplicationConstants.ZOO_WORK_QUEUE
+ "/"
@@ -85,7 +88,7 @@ public class SequentialWorkAssignerTest {
                     new ReplicationTarget("cluster1", "2", Table.ID.of("2")))))
                         .andReturn(new byte[0]);
 
-    replay(workQueue, zooCache, client);
+    replay(workQueue, zooCache, opts, client);
 
     assigner.cleanupFinishedWork();
 
diff --git a/server/master/src/test/java/org/apache/accumulo/master/replication/UnorderedWorkAssignerTest.java
b/server/master/src/test/java/org/apache/accumulo/master/replication/UnorderedWorkAssignerTest.java
index 87e04fe..6ce5e91 100644
--- a/server/master/src/test/java/org/apache/accumulo/master/replication/UnorderedWorkAssignerTest.java
+++ b/server/master/src/test/java/org/apache/accumulo/master/replication/UnorderedWorkAssignerTest.java
@@ -33,6 +33,7 @@ import java.util.UUID;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloClient;
+import org.apache.accumulo.core.client.admin.InstanceOperations;
 import org.apache.accumulo.core.clientImpl.Table;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.replication.ReplicationConstants;
@@ -112,13 +113,16 @@ public class UnorderedWorkAssignerTest {
     ZooCache cache = createMock(ZooCache.class);
     assigner.setZooCache(cache);
 
-    expect(client.getInstanceID()).andReturn("id");
+    InstanceOperations opts = createMock(InstanceOperations.class);
+    expect(opts.getInstanceID()).andReturn("id");
+    expect(client.instanceOperations()).andReturn(opts);
+
     expect(cache.get(Constants.ZROOT + "/id" + ReplicationConstants.ZOO_WORK_QUEUE + "/wal1"))
         .andReturn(null);
     expect(cache.get(Constants.ZROOT + "/id" + ReplicationConstants.ZOO_WORK_QUEUE + "/wal2"))
         .andReturn(null);
 
-    replay(cache, client);
+    replay(cache, opts, client);
 
     assigner.cleanupFinishedWork();
 
diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
index 7f29210..a63b43f 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -620,7 +620,7 @@ public class Shell extends ShellOptions implements KeywordExecutable {
     ClientInfo info = ClientInfo.from(accumuloClient.properties());
     reader.print("\n" + SHELL_DESCRIPTION + "\n" + "- \n" + "- version: " + Constants.VERSION
+ "\n"
         + "- instance name: " + info.getInstanceName() + "\n" + "- instance id: "
-        + accumuloClient.getInstanceID() + "\n" + "- \n"
+        + accumuloClient.instanceOperations().getInstanceID() + "\n" + "- \n"
         + "- type 'help' for a list of available commands\n" + "- \n");
     reader.flush();
   }
diff --git a/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java b/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
index afe937b..027b263 100644
--- a/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
@@ -100,7 +100,8 @@ public class BadDeleteMarkersCreatedIT extends AccumuloClusterHarness
{
       ClientInfo info = ClientInfo.from(client.properties());
       ZooCache zcache = new ZooCache(info.getZooKeepers(), info.getZooKeepersSessionTimeOut());
       zcache.clear();
-      String path = ZooUtil.getRoot(client.getInstanceID()) + Constants.ZGC_LOCK;
+      String path = ZooUtil.getRoot(client.instanceOperations().getInstanceID())
+          + Constants.ZGC_LOCK;
       byte[] gcLockData;
       do {
         gcLockData = ZooLock.getLockData(zcache, path, null);
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 0820be5..7268a0f 100644
--- a/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
@@ -120,7 +120,8 @@ public class ExistingMacIT extends ConfigurableMacBase {
         getCluster().getConfig().getSiteConfig().get(Property.INSTANCE_ZK_TIMEOUT.getKey()));
     IZooReaderWriter zrw = new ZooReaderWriterFactory().getZooReaderWriter(
         getCluster().getZooKeepers(), (int) zkTimeout, defaultConfig.get(Property.INSTANCE_SECRET));
-    final String zInstanceRoot = Constants.ZROOT + "/" + client.getInstanceID();
+    final String zInstanceRoot = Constants.ZROOT + "/"
+        + client.instanceOperations().getInstanceID();
     while (!AccumuloStatus.isAccumuloOffline(zrw, zInstanceRoot)) {
       log.debug("Accumulo services still have their ZK locks held");
       Thread.sleep(1000);
diff --git a/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java
b/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java
index ee5a9a8..bf45d07 100644
--- a/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java
@@ -133,7 +133,7 @@ public class ThriftServerBindsBeforeZooKeeperLockIT extends AccumuloClusterHarne
   public void testMasterService() throws Exception {
     final MiniAccumuloClusterImpl cluster = (MiniAccumuloClusterImpl) getCluster();
     try (AccumuloClient client = createAccumuloClient()) {
-      final String instanceID = client.getInstanceID();
+      final String instanceID = client.instanceOperations().getInstanceID();
 
       // Wait for the Master to grab its lock
       while (true) {
@@ -201,7 +201,7 @@ public class ThriftServerBindsBeforeZooKeeperLockIT extends AccumuloClusterHarne
   public void testGarbageCollectorPorts() throws Exception {
     final MiniAccumuloClusterImpl cluster = (MiniAccumuloClusterImpl) getCluster();
     try (AccumuloClient client = createAccumuloClient()) {
-      String instanceID = client.getInstanceID();
+      String instanceID = client.instanceOperations().getInstanceID();
 
       // Wait for the Master to grab its lock
       while (true) {
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 5986738..7dcfb47 100644
--- a/test/src/main/java/org/apache/accumulo/test/VolumeIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/VolumeIT.java
@@ -302,7 +302,7 @@ public class VolumeIT extends ConfigurableMacBase {
   // grab uuid before shutting down cluster
   private String verifyAndShutdownCluster(AccumuloClient c, PropertiesConfiguration conf,
       String tableName) throws Exception {
-    String uuid = c.getInstanceID();
+    String uuid = c.instanceOperations().getInstanceID();
 
     verifyVolumesUsed(c, tableName, false, v1, v2);
 
@@ -479,7 +479,8 @@ public class VolumeIT extends ConfigurableMacBase {
 
       // check that root tablet is not on volume 1
       ZooReader zreader = new ZooReader(cluster.getZooKeepers(), 30000);
-      String zpath = ZooUtil.getRoot(client.getInstanceID()) + RootTable.ZROOT_TABLET_PATH;
+      String zpath = ZooUtil.getRoot(client.instanceOperations().getInstanceID())
+          + RootTable.ZROOT_TABLET_PATH;
       String rootTabletDir = new String(zreader.getData(zpath, false, null), UTF_8);
       assertTrue(rootTabletDir.startsWith(v2.toString()));
 
@@ -541,7 +542,8 @@ public class VolumeIT extends ConfigurableMacBase {
 
     // check that root tablet is not on volume 1 or 2
     ZooReader zreader = new ZooReader(cluster.getZooKeepers(), 30000);
-    String zpath = ZooUtil.getRoot(client.getInstanceID()) + RootTable.ZROOT_TABLET_PATH;
+    String zpath = ZooUtil.getRoot(client.instanceOperations().getInstanceID())
+        + RootTable.ZROOT_TABLET_PATH;
     String rootTabletDir = new String(zreader.getData(zpath, false, null), UTF_8);
     assertTrue(rootTabletDir.startsWith(v8.toString()) || rootTabletDir.startsWith(v9.toString()));
 
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/AccumuloClientIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/AccumuloClientIT.java
index a46ca7f..12e18f2 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/AccumuloClientIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/AccumuloClientIT.java
@@ -190,7 +190,7 @@ public class AccumuloClientIT extends AccumuloClusterHarness {
     expectClosed(() -> c.securityOperations());
     expectClosed(() -> c.namespaceOperations());
     expectClosed(() -> c.properties());
-    expectClosed(() -> c.getInstanceID());
+    expectClosed(() -> c.instanceOperations().getInstanceID());
 
     // check a few table ops to ensure they fail
     expectClosed(() -> tops.create("expectFail"));
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 fe0b5cc..ed42e9a 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
@@ -45,7 +45,7 @@ public class BackupMasterIT extends ConfigurableMacBase {
       String secret = getCluster().getSiteConfiguration().get(Property.INSTANCE_SECRET);
       IZooReaderWriter writer = new ZooReaderWriterFactory()
           .getZooReaderWriter(cluster.getZooKeepers(), 30 * 1000, secret);
-      String root = "/accumulo/" + client.getInstanceID();
+      String root = "/accumulo/" + client.instanceOperations().getInstanceID();
       List<String> children = Collections.emptyList();
       // wait for 2 lock entries
       do {
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
index 3e51c0f..6374976 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
@@ -159,7 +159,7 @@ public class BalanceInPresenceOfOfflineTableIT extends AccumuloClusterHarness
{
         try {
           client = MasterClient.getConnectionWithRetry((ClientContext) accumuloClient);
           stats = client.getMasterStats(Tracer.traceInfo(),
-              creds.toThrift(accumuloClient.getInstanceID()));
+              creds.toThrift(accumuloClient.instanceOperations().getInstanceID()));
           break;
         } catch (ThriftSecurityException exception) {
           throw new AccumuloSecurityException(exception);
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
index 281dcf3..9ef2568 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
@@ -105,7 +105,8 @@ public class DynamicThreadPoolsIT extends AccumuloClusterHarness {
         while (true) {
           try {
             client = MasterClient.getConnectionWithRetry((ClientContext) c);
-            stats = client.getMasterStats(Tracer.traceInfo(), creds.toThrift(c.getInstanceID()));
+            stats = client.getMasterStats(Tracer.traceInfo(),
+                creds.toThrift(c.instanceOperations().getInstanceID()));
             break;
           } catch (ThriftNotActiveServiceException e) {
             // Let it loop, fetching a new location
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 7c5f458..ab8420f 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
@@ -254,7 +254,8 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
     try (AccumuloClient client = createClient()) {
 
       ZooReaderWriter zk = new ZooReaderWriter(cluster.getZooKeepers(), 30000, OUR_SECRET);
-      String path = ZooUtil.getRoot(client.getInstanceID()) + Constants.ZGC_LOCK;
+      String path = ZooUtil.getRoot(client.instanceOperations().getInstanceID())
+          + Constants.ZGC_LOCK;
       for (int i = 0; i < 5; i++) {
         List<String> locks;
         try {
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java
index ef5e41c..9171016 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java
@@ -192,7 +192,9 @@ public class ReadWriteIT extends AccumuloClusterHarness {
       byte[] masterLockData;
       do {
         masterLockData = ZooLock.getLockData(zcache,
-            ZooUtil.getRoot(accumuloClient.getInstanceID()) + Constants.ZMASTER_LOCK, null);
+            ZooUtil.getRoot(accumuloClient.instanceOperations().getInstanceID())
+                + Constants.ZMASTER_LOCK,
+            null);
         if (masterLockData != null) {
           log.info("Master lock is still held");
           Thread.sleep(1000);
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java b/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java
index e55ec26..5291e3b 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java
@@ -173,7 +173,7 @@ public class RestartIT extends AccumuloClusterHarness {
       byte[] masterLockData;
       do {
         masterLockData = ZooLock.getLockData(zcache,
-            ZooUtil.getRoot(c.getInstanceID()) + Constants.ZMASTER_LOCK, null);
+            ZooUtil.getRoot(c.instanceOperations().getInstanceID()) + Constants.ZMASTER_LOCK,
null);
         if (masterLockData != null) {
           log.info("Master lock is still held");
           Thread.sleep(1000);
@@ -187,7 +187,7 @@ public class RestartIT extends AccumuloClusterHarness {
       masterLockData = new byte[0];
       do {
         masterLockData = ZooLock.getLockData(zcache,
-            ZooUtil.getRoot(c.getInstanceID()) + Constants.ZMASTER_LOCK, null);
+            ZooUtil.getRoot(c.instanceOperations().getInstanceID()) + Constants.ZMASTER_LOCK,
null);
         if (masterLockData != null) {
           log.info("Master lock is still held");
           Thread.sleep(1000);
@@ -242,7 +242,7 @@ public class RestartIT extends AccumuloClusterHarness {
       byte[] masterLockData;
       do {
         masterLockData = ZooLock.getLockData(zcache,
-            ZooUtil.getRoot(c.getInstanceID()) + Constants.ZMASTER_LOCK, null);
+            ZooUtil.getRoot(c.instanceOperations().getInstanceID()) + Constants.ZMASTER_LOCK,
null);
         if (masterLockData != null) {
           log.info("Master lock is still held");
           Thread.sleep(1000);
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 10035d0..f31b0f1 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
@@ -87,7 +87,8 @@ public class SimpleBalancerFairnessIT extends ConfigurableMacBase {
         while (true) {
           try {
             client = MasterClient.getConnectionWithRetry((ClientContext) c);
-            stats = client.getMasterStats(Tracer.traceInfo(), creds.toThrift(c.getInstanceID()));
+            stats = client.getMasterStats(Tracer.traceInfo(),
+                creds.toThrift(c.instanceOperations().getInstanceID()));
             break;
           } catch (ThriftNotActiveServiceException e) {
             // Let it loop, fetching a new location
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/TableChangeStateIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/TableChangeStateIT.java
index 900445b..46f170c 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/TableChangeStateIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/TableChangeStateIT.java
@@ -246,9 +246,11 @@ public class TableChangeStateIT extends AccumuloClusterHarness {
       IZooReaderWriter zk = new ZooReaderWriterFactory().getZooReaderWriter(info.getZooKeepers(),
           info.getZooKeepersSessionTimeOut(), secret);
       ZooStore<String> zs = new ZooStore<>(
-          ZooUtil.getRoot(accumuloClient.getInstanceID()) + Constants.ZFATE, zk);
+          ZooUtil.getRoot(accumuloClient.instanceOperations().getInstanceID()) + Constants.ZFATE,
+          zk);
       AdminUtil.FateStatus fateStatus = admin.getStatus(zs, zk,
-          ZooUtil.getRoot(accumuloClient.getInstanceID()) + Constants.ZTABLE_LOCKS + "/"
+ tableId,
+          ZooUtil.getRoot(accumuloClient.instanceOperations().getInstanceID())
+              + Constants.ZTABLE_LOCKS + "/" + tableId,
           null, null);
 
       for (AdminUtil.TransactionStatus tx : fateStatus.getTransactions()) {
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java
index 61a4b6c..8635868 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java
@@ -241,8 +241,8 @@ public class TabletStateChangeIteratorIT extends AccumuloClusterHarness
{
       HashSet<TServerInstance> tservers = new HashSet<>();
       for (String tserver : client.instanceOperations().getTabletServers()) {
         try {
-          String zPath = ZooUtil.getRoot(client.getInstanceID()) + Constants.ZTSERVERS +
"/"
-              + tserver;
+          String zPath = ZooUtil.getRoot(client.instanceOperations().getInstanceID())
+              + Constants.ZTSERVERS + "/" + tserver;
           ClientInfo info = getClientInfo();
           long sessionId = ZooLock.getSessionId(
               new ZooCache(info.getZooKeepers(), info.getZooKeepersSessionTimeOut()), zPath);
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 30291ab..7916d98 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
@@ -67,15 +67,16 @@ public class MultiTserverReplicationIT extends ConfigurableMacBase {
       ZooReader zreader = new ZooReader(context.getZooKeepers(),
           context.getZooKeepersSessionTimeOut());
       Set<String> tserverHost = new HashSet<>();
-      tserverHost.addAll(
-          zreader.getChildren(ZooUtil.getRoot(client.getInstanceID()) + Constants.ZTSERVERS));
+      tserverHost.addAll(zreader.getChildren(
+          ZooUtil.getRoot(client.instanceOperations().getInstanceID()) + Constants.ZTSERVERS));
 
       Set<HostAndPort> replicationServices = new HashSet<>();
 
       for (String tserver : tserverHost) {
         try {
-          byte[] portData = zreader.getData(ZooUtil.getRoot(client.getInstanceID())
-              + ReplicationConstants.ZOO_TSERVERS + "/" + tserver, null);
+          byte[] portData = zreader
+              .getData(ZooUtil.getRoot(client.instanceOperations().getInstanceID())
+                  + ReplicationConstants.ZOO_TSERVERS + "/" + tserver, null);
           HostAndPort replAddress = HostAndPort.fromString(new String(portData, UTF_8));
           replicationServices.add(replAddress);
         } catch (Exception e) {
@@ -111,9 +112,10 @@ public class MultiTserverReplicationIT extends ConfigurableMacBase {
       String masterAddr = Iterables.getOnlyElement(context.getMasterLocations());
 
       // Get the master replication coordinator addr
-      String replCoordAddr = new String(zreader.getData(
-          ZooUtil.getRoot(client.getInstanceID()) + Constants.ZMASTER_REPLICATION_COORDINATOR_ADDR,
-          null), UTF_8);
+      String replCoordAddr = new String(
+          zreader.getData(ZooUtil.getRoot(client.instanceOperations().getInstanceID())
+              + Constants.ZMASTER_REPLICATION_COORDINATOR_ADDR, null),
+          UTF_8);
 
       // They shouldn't be the same
       assertNotEquals(masterAddr, replCoordAddr);
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 46097ad..f17b121 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
@@ -202,7 +202,8 @@ public class ReplicationIT extends ConfigurableMacBase {
     ZooCacheFactory zcf = new ZooCacheFactory();
     ClientInfo info = ClientInfo.from(client.properties());
     ZooCache zcache = zcf.getZooCache(info.getZooKeepers(), info.getZooKeepersSessionTimeOut());
-    String zkPath = ZooUtil.getRoot(client.getInstanceID()) + Constants.ZGC_LOCK;
+    String zkPath = ZooUtil.getRoot(client.instanceOperations().getInstanceID())
+        + Constants.ZGC_LOCK;
     log.info("Looking for GC lock at {}", zkPath);
     byte[] data = ZooLock.getLockData(zcache, zkPath, null);
     while (data == null) {


Mime
View raw message