You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/05/25 21:07:55 UTC

[GitHub] mikewalch closed pull request #502: Replace Anonymous types with lambdas

mikewalch closed pull request #502: Replace Anonymous types with lambdas
URL: https://github.com/apache/accumulo/pull/502
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/InstanceOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/InstanceOperationsImpl.java
index 1ba9e4b3b7..157c7c9225 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/InstanceOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/InstanceOperationsImpl.java
@@ -33,10 +33,8 @@
 import org.apache.accumulo.core.client.admin.ActiveCompaction;
 import org.apache.accumulo.core.client.admin.ActiveScan;
 import org.apache.accumulo.core.client.admin.InstanceOperations;
-import org.apache.accumulo.core.client.impl.thrift.ClientService;
 import org.apache.accumulo.core.client.impl.thrift.ConfigurationType;
 import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
-import org.apache.accumulo.core.master.thrift.MasterClientService;
 import org.apache.accumulo.core.rpc.ThriftUtil;
 import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
 import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Client;
@@ -66,50 +64,30 @@ public void setProperty(final String property, final String value)
       throws AccumuloException, AccumuloSecurityException, IllegalArgumentException {
     checkArgument(property != null, "property is null");
     checkArgument(value != null, "value is null");
-    MasterClient.executeVoid(context, new ClientExec<MasterClientService.Client>() {
-      @Override
-      public void execute(MasterClientService.Client client) throws Exception {
-        client.setSystemProperty(Tracer.traceInfo(), context.rpcCreds(), property, value);
-      }
-    });
+    MasterClient.executeVoid(context, client -> client.setSystemProperty(Tracer.traceInfo(),
+        context.rpcCreds(), property, value));
   }
 
   @Override
   public void removeProperty(final String property)
       throws AccumuloException, AccumuloSecurityException {
     checkArgument(property != null, "property is null");
-    MasterClient.executeVoid(context, new ClientExec<MasterClientService.Client>() {
-      @Override
-      public void execute(MasterClientService.Client client) throws Exception {
-        client.removeSystemProperty(Tracer.traceInfo(), context.rpcCreds(), property);
-      }
-    });
+    MasterClient.executeVoid(context,
+        client -> client.removeSystemProperty(Tracer.traceInfo(), context.rpcCreds(), property));
   }
 
   @Override
   public Map<String,String> getSystemConfiguration()
       throws AccumuloException, AccumuloSecurityException {
-    return ServerClient.execute(context,
-        new ClientExecReturn<Map<String,String>,ClientService.Client>() {
-          @Override
-          public Map<String,String> execute(ClientService.Client client) throws Exception {
-            return client.getConfiguration(Tracer.traceInfo(), context.rpcCreds(),
-                ConfigurationType.CURRENT);
-          }
-        });
+    return ServerClient.execute(context, client -> client.getConfiguration(Tracer.traceInfo(),
+        context.rpcCreds(), ConfigurationType.CURRENT));
   }
 
   @Override
   public Map<String,String> getSiteConfiguration()
       throws AccumuloException, AccumuloSecurityException {
-    return ServerClient.execute(context,
-        new ClientExecReturn<Map<String,String>,ClientService.Client>() {
-          @Override
-          public Map<String,String> execute(ClientService.Client client) throws Exception {
-            return client.getConfiguration(Tracer.traceInfo(), context.rpcCreds(),
-                ConfigurationType.SITE);
-          }
-        });
+    return ServerClient.execute(context, client -> client.getConfiguration(Tracer.traceInfo(),
+        context.rpcCreds(), ConfigurationType.SITE));
   }
 
   @Override
@@ -166,12 +144,8 @@ public void execute(MasterClientService.Client client) throws Exception {
   @Override
   public boolean testClassLoad(final String className, final String asTypeName)
       throws AccumuloException, AccumuloSecurityException {
-    return ServerClient.execute(context, new ClientExecReturn<Boolean,ClientService.Client>() {
-      @Override
-      public Boolean execute(ClientService.Client client) throws Exception {
-        return client.checkClass(Tracer.traceInfo(), context.rpcCreds(), className, asTypeName);
-      }
-    });
+    return ServerClient.execute(context,
+        client -> client.checkClass(Tracer.traceInfo(), context.rpcCreds(), className, asTypeName));
   }
 
   @Override
@@ -220,12 +194,7 @@ public void ping(String tserver) throws AccumuloException {
   @Override
   public void waitForBalance() throws AccumuloException {
     try {
-      MasterClient.executeVoid(context, new ClientExec<MasterClientService.Client>() {
-        @Override
-        public void execute(MasterClientService.Client client) throws Exception {
-          client.waitForBalance(Tracer.traceInfo());
-        }
-      });
+      MasterClient.executeVoid(context, client -> client.waitForBalance(Tracer.traceInfo()));
     } catch (AccumuloSecurityException ex) {
       // should never happen
       throw new RuntimeException("Unexpected exception thrown", ex);
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java
index e8826c1d23..ec45d90c69 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java
@@ -42,7 +42,6 @@
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.admin.TableOperations;
-import org.apache.accumulo.core.client.impl.thrift.ClientService;
 import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
 import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
 import org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException;
@@ -50,7 +49,6 @@
 import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.master.thrift.FateOperation;
-import org.apache.accumulo.core.master.thrift.MasterClientService;
 import org.apache.accumulo.core.trace.Tracer;
 import org.apache.accumulo.core.util.OpTimer;
 import org.slf4j.Logger;
@@ -175,13 +173,8 @@ public void setProperty(final String namespace, final String property, final Str
     checkArgument(property != null, "property is null");
     checkArgument(value != null, "value is null");
 
-    MasterClient.executeNamespace(context, new ClientExec<MasterClientService.Client>() {
-      @Override
-      public void execute(MasterClientService.Client client) throws Exception {
-        client.setNamespaceProperty(Tracer.traceInfo(), context.rpcCreds(), namespace, property,
-            value);
-      }
-    });
+    MasterClient.executeNamespace(context, client -> client.setNamespaceProperty(Tracer.traceInfo(),
+        context.rpcCreds(), namespace, property, value));
   }
 
   @Override
@@ -190,12 +183,8 @@ public void removeProperty(final String namespace, final String property)
     checkArgument(namespace != null, "namespace is null");
     checkArgument(property != null, "property is null");
 
-    MasterClient.executeNamespace(context, new ClientExec<MasterClientService.Client>() {
-      @Override
-      public void execute(MasterClientService.Client client) throws Exception {
-        client.removeNamespaceProperty(Tracer.traceInfo(), context.rpcCreds(), namespace, property);
-      }
-    });
+    MasterClient.executeNamespace(context, client -> client
+        .removeNamespaceProperty(Tracer.traceInfo(), context.rpcCreds(), namespace, property));
   }
 
   @Override
@@ -203,14 +192,8 @@ public void execute(MasterClientService.Client client) throws Exception {
       throws AccumuloException, NamespaceNotFoundException {
     checkArgument(namespace != null, "namespace is null");
     try {
-      return ServerClient
-          .executeRaw(context, new ClientExecReturn<Map<String,String>,ClientService.Client>() {
-            @Override
-            public Map<String,String> execute(ClientService.Client client) throws Exception {
-              return client.getNamespaceConfiguration(Tracer.traceInfo(), context.rpcCreds(),
-                  namespace);
-            }
-          }).entrySet();
+      return ServerClient.executeRaw(context, client -> client
+          .getNamespaceConfiguration(Tracer.traceInfo(), context.rpcCreds(), namespace)).entrySet();
     } catch (ThriftTableOperationException e) {
       switch (e.getType()) {
         case NAMESPACE_NOTFOUND:
@@ -244,13 +227,9 @@ public boolean testClassLoad(final String namespace, final String className,
     checkArgument(asTypeName != null, "asTypeName is null");
 
     try {
-      return ServerClient.executeRaw(context, new ClientExecReturn<Boolean,ClientService.Client>() {
-        @Override
-        public Boolean execute(ClientService.Client client) throws Exception {
-          return client.checkNamespaceClass(Tracer.traceInfo(), context.rpcCreds(), namespace,
-              className, asTypeName);
-        }
-      });
+      return ServerClient.executeRaw(context,
+          client -> client.checkNamespaceClass(Tracer.traceInfo(), context.rpcCreds(), namespace,
+              className, asTypeName));
     } catch (ThriftTableOperationException e) {
       switch (e.getType()) {
         case NAMESPACE_NOTFOUND:
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java
index 9421a978e5..d576494aeb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java
@@ -37,7 +37,6 @@
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.master.thrift.MasterClientService.Client;
 import org.apache.accumulo.core.metadata.MetadataTable;
 import org.apache.accumulo.core.metadata.schema.MetadataSchema;
 import org.apache.accumulo.core.metadata.schema.MetadataSchema.ReplicationSection;
@@ -117,12 +116,8 @@ public void drain(final String tableName, final Set<String> wals)
   protected boolean getMasterDrain(final TInfo tinfo, final TCredentials rpcCreds,
       final String tableName, final Set<String> wals)
       throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
-    return MasterClient.execute(context, new ClientExecReturn<Boolean,Client>() {
-      @Override
-      public Boolean execute(Client client) throws Exception {
-        return client.drainReplicationTable(tinfo, rpcCreds, tableName, wals);
-      }
-    });
+    return MasterClient.execute(context,
+        client -> client.drainReplicationTable(tinfo, rpcCreds, tableName, wals));
   }
 
   protected Table.ID getTableId(Connector conn, String tableName)
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/SecurityOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/SecurityOperationsImpl.java
index 3c49c6bb6b..6c3a774f4f 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/SecurityOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/SecurityOperationsImpl.java
@@ -35,7 +35,6 @@
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.client.security.tokens.DelegationToken;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
-import org.apache.accumulo.core.master.thrift.MasterClientService.Client;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.NamespacePermission;
 import org.apache.accumulo.core.security.SystemPermission;
@@ -111,16 +110,13 @@ public void createLocalUser(final String principal, final PasswordToken password
     if (null == context.getSaslParams()) {
       checkArgument(password != null, "password is null");
     }
-    executeVoid(new ClientExec<ClientService.Client>() {
-      @Override
-      public void execute(ClientService.Client client) throws Exception {
-        if (null == context.getSaslParams()) {
-          client.createLocalUser(Tracer.traceInfo(), context.rpcCreds(), principal,
-              ByteBuffer.wrap(password.getPassword()));
-        } else {
-          client.createLocalUser(Tracer.traceInfo(), context.rpcCreds(), principal,
-              ByteBuffer.wrap(new byte[0]));
-        }
+    executeVoid(client -> {
+      if (null == context.getSaslParams()) {
+        client.createLocalUser(Tracer.traceInfo(), context.rpcCreds(), principal,
+            ByteBuffer.wrap(password.getPassword()));
+      } else {
+        client.createLocalUser(Tracer.traceInfo(), context.rpcCreds(), principal,
+            ByteBuffer.wrap(new byte[0]));
       }
     });
   }
@@ -135,12 +131,7 @@ public void dropUser(final String user) throws AccumuloException, AccumuloSecuri
   public void dropLocalUser(final String principal)
       throws AccumuloException, AccumuloSecurityException {
     checkArgument(principal != null, "principal is null");
-    executeVoid(new ClientExec<ClientService.Client>() {
-      @Override
-      public void execute(ClientService.Client client) throws Exception {
-        client.dropLocalUser(Tracer.traceInfo(), context.rpcCreds(), principal);
-      }
-    });
+    executeVoid(client -> client.dropLocalUser(Tracer.traceInfo(), context.rpcCreds(), principal));
   }
 
   @Deprecated
@@ -156,13 +147,8 @@ public boolean authenticateUser(final String principal, final AuthenticationToke
     checkArgument(principal != null, "principal is null");
     checkArgument(token != null, "token is null");
     final Credentials toAuth = new Credentials(principal, token);
-    return execute(new ClientExecReturn<Boolean,ClientService.Client>() {
-      @Override
-      public Boolean execute(ClientService.Client client) throws Exception {
-        return client.authenticateUser(Tracer.traceInfo(), context.rpcCreds(),
-            toAuth.toThrift(context.getInstance()));
-      }
-    });
+    return execute(client -> client.authenticateUser(Tracer.traceInfo(), context.rpcCreds(),
+        toAuth.toThrift(context.getInstance())));
   }
 
   @Override
@@ -178,13 +164,8 @@ public void changeLocalUserPassword(final String principal, final PasswordToken
     checkArgument(principal != null, "principal is null");
     checkArgument(token != null, "token is null");
     final Credentials toChange = new Credentials(principal, token);
-    executeVoid(new ClientExec<ClientService.Client>() {
-      @Override
-      public void execute(ClientService.Client client) throws Exception {
-        client.changeLocalUserPassword(Tracer.traceInfo(), context.rpcCreds(), principal,
-            ByteBuffer.wrap(token.getPassword()));
-      }
-    });
+    executeVoid(client -> client.changeLocalUserPassword(Tracer.traceInfo(), context.rpcCreds(),
+        principal, ByteBuffer.wrap(token.getPassword())));
     if (context.getCredentials().getPrincipal().equals(principal)) {
       context.setCredentials(toChange);
     }
@@ -195,26 +176,16 @@ public void changeUserAuthorizations(final String principal, final Authorization
       throws AccumuloException, AccumuloSecurityException {
     checkArgument(principal != null, "principal is null");
     checkArgument(authorizations != null, "authorizations is null");
-    executeVoid(new ClientExec<ClientService.Client>() {
-      @Override
-      public void execute(ClientService.Client client) throws Exception {
-        client.changeAuthorizations(Tracer.traceInfo(), context.rpcCreds(), principal,
-            ByteBufferUtil.toByteBuffers(authorizations.getAuthorizations()));
-      }
-    });
+    executeVoid(client -> client.changeAuthorizations(Tracer.traceInfo(), context.rpcCreds(),
+        principal, ByteBufferUtil.toByteBuffers(authorizations.getAuthorizations())));
   }
 
   @Override
   public Authorizations getUserAuthorizations(final String principal)
       throws AccumuloException, AccumuloSecurityException {
     checkArgument(principal != null, "principal is null");
-    return execute(new ClientExecReturn<Authorizations,ClientService.Client>() {
-      @Override
-      public Authorizations execute(ClientService.Client client) throws Exception {
-        return new Authorizations(
-            client.getUserAuthorizations(Tracer.traceInfo(), context.rpcCreds(), principal));
-      }
-    });
+    return execute(client -> new Authorizations(
+        client.getUserAuthorizations(Tracer.traceInfo(), context.rpcCreds(), principal)));
   }
 
   @Override
@@ -222,13 +193,8 @@ public boolean hasSystemPermission(final String principal, final SystemPermissio
       throws AccumuloException, AccumuloSecurityException {
     checkArgument(principal != null, "principal is null");
     checkArgument(perm != null, "perm is null");
-    return execute(new ClientExecReturn<Boolean,ClientService.Client>() {
-      @Override
-      public Boolean execute(ClientService.Client client) throws Exception {
-        return client.hasSystemPermission(Tracer.traceInfo(), context.rpcCreds(), principal,
-            perm.getId());
-      }
-    });
+    return execute(client -> client.hasSystemPermission(Tracer.traceInfo(), context.rpcCreds(),
+        principal, perm.getId()));
   }
 
   @Override
@@ -238,13 +204,8 @@ public boolean hasTablePermission(final String principal, final String table,
     checkArgument(table != null, "table is null");
     checkArgument(perm != null, "perm is null");
     try {
-      return execute(new ClientExecReturn<Boolean,ClientService.Client>() {
-        @Override
-        public Boolean execute(ClientService.Client client) throws Exception {
-          return client.hasTablePermission(Tracer.traceInfo(), context.rpcCreds(), principal, table,
-              perm.getId());
-        }
-      });
+      return execute(client -> client.hasTablePermission(Tracer.traceInfo(), context.rpcCreds(),
+          principal, table, perm.getId()));
     } catch (AccumuloSecurityException e) {
       if (e.getSecurityErrorCode() == NAMESPACE_DOESNT_EXIST)
         throw new AccumuloSecurityException(null, SecurityErrorCode.TABLE_DOESNT_EXIST, e);
@@ -259,13 +220,8 @@ public boolean hasNamespacePermission(final String principal, final String names
     checkArgument(principal != null, "principal is null");
     checkArgument(namespace != null, "namespace is null");
     checkArgument(permission != null, "permission is null");
-    return execute(new ClientExecReturn<Boolean,ClientService.Client>() {
-      @Override
-      public Boolean execute(ClientService.Client client) throws Exception {
-        return client.hasNamespacePermission(Tracer.traceInfo(), context.rpcCreds(), principal,
-            namespace, permission.getId());
-      }
-    });
+    return execute(client -> client.hasNamespacePermission(Tracer.traceInfo(), context.rpcCreds(),
+        principal, namespace, permission.getId()));
   }
 
   @Override
@@ -273,13 +229,8 @@ public void grantSystemPermission(final String principal, final SystemPermission
       throws AccumuloException, AccumuloSecurityException {
     checkArgument(principal != null, "principal is null");
     checkArgument(permission != null, "permission is null");
-    executeVoid(new ClientExec<ClientService.Client>() {
-      @Override
-      public void execute(ClientService.Client client) throws Exception {
-        client.grantSystemPermission(Tracer.traceInfo(), context.rpcCreds(), principal,
-            permission.getId());
-      }
-    });
+    executeVoid(client -> client.grantSystemPermission(Tracer.traceInfo(), context.rpcCreds(),
+        principal, permission.getId()));
   }
 
   @Override
@@ -289,13 +240,8 @@ public void grantTablePermission(final String principal, final String table,
     checkArgument(table != null, "table is null");
     checkArgument(permission != null, "permission is null");
     try {
-      executeVoid(new ClientExec<ClientService.Client>() {
-        @Override
-        public void execute(ClientService.Client client) throws Exception {
-          client.grantTablePermission(Tracer.traceInfo(), context.rpcCreds(), principal, table,
-              permission.getId());
-        }
-      });
+      executeVoid(client -> client.grantTablePermission(Tracer.traceInfo(), context.rpcCreds(),
+          principal, table, permission.getId()));
     } catch (AccumuloSecurityException e) {
       if (e.getSecurityErrorCode() == NAMESPACE_DOESNT_EXIST)
         throw new AccumuloSecurityException(null, SecurityErrorCode.TABLE_DOESNT_EXIST, e);
@@ -310,13 +256,8 @@ public void grantNamespacePermission(final String principal, final String namesp
     checkArgument(principal != null, "principal is null");
     checkArgument(namespace != null, "namespace is null");
     checkArgument(permission != null, "permission is null");
-    executeVoid(new ClientExec<ClientService.Client>() {
-      @Override
-      public void execute(ClientService.Client client) throws Exception {
-        client.grantNamespacePermission(Tracer.traceInfo(), context.rpcCreds(), principal,
-            namespace, permission.getId());
-      }
-    });
+    executeVoid(client -> client.grantNamespacePermission(Tracer.traceInfo(), context.rpcCreds(),
+        principal, namespace, permission.getId()));
   }
 
   @Override
@@ -324,13 +265,8 @@ public void revokeSystemPermission(final String principal, final SystemPermissio
       throws AccumuloException, AccumuloSecurityException {
     checkArgument(principal != null, "principal is null");
     checkArgument(permission != null, "permission is null");
-    executeVoid(new ClientExec<ClientService.Client>() {
-      @Override
-      public void execute(ClientService.Client client) throws Exception {
-        client.revokeSystemPermission(Tracer.traceInfo(), context.rpcCreds(), principal,
-            permission.getId());
-      }
-    });
+    executeVoid(client -> client.revokeSystemPermission(Tracer.traceInfo(), context.rpcCreds(),
+        principal, permission.getId()));
   }
 
   @Override
@@ -340,13 +276,8 @@ public void revokeTablePermission(final String principal, final String table,
     checkArgument(table != null, "table is null");
     checkArgument(permission != null, "permission is null");
     try {
-      executeVoid(new ClientExec<ClientService.Client>() {
-        @Override
-        public void execute(ClientService.Client client) throws Exception {
-          client.revokeTablePermission(Tracer.traceInfo(), context.rpcCreds(), principal, table,
-              permission.getId());
-        }
-      });
+      executeVoid(client -> client.revokeTablePermission(Tracer.traceInfo(), context.rpcCreds(),
+          principal, table, permission.getId()));
     } catch (AccumuloSecurityException e) {
       if (e.getSecurityErrorCode() == NAMESPACE_DOESNT_EXIST)
         throw new AccumuloSecurityException(null, SecurityErrorCode.TABLE_DOESNT_EXIST, e);
@@ -361,13 +292,8 @@ public void revokeNamespacePermission(final String principal, final String names
     checkArgument(principal != null, "principal is null");
     checkArgument(namespace != null, "namespace is null");
     checkArgument(permission != null, "permission is null");
-    executeVoid(new ClientExec<ClientService.Client>() {
-      @Override
-      public void execute(ClientService.Client client) throws Exception {
-        client.revokeNamespacePermission(Tracer.traceInfo(), context.rpcCreds(), principal,
-            namespace, permission.getId());
-      }
-    });
+    executeVoid(client -> client.revokeNamespacePermission(Tracer.traceInfo(), context.rpcCreds(),
+        principal, namespace, permission.getId()));
   }
 
   @Deprecated
@@ -378,12 +304,7 @@ public void execute(ClientService.Client client) throws Exception {
 
   @Override
   public Set<String> listLocalUsers() throws AccumuloException, AccumuloSecurityException {
-    return execute(new ClientExecReturn<Set<String>,ClientService.Client>() {
-      @Override
-      public Set<String> execute(ClientService.Client client) throws Exception {
-        return client.listLocalUsers(Tracer.traceInfo(), context.rpcCreds());
-      }
-    });
+    return execute(client -> client.listLocalUsers(Tracer.traceInfo(), context.rpcCreds()));
   }
 
   @Override
@@ -398,12 +319,8 @@ public DelegationToken getDelegationToken(DelegationTokenConfig cfg)
 
     TDelegationToken thriftToken;
     try {
-      thriftToken = MasterClient.execute(context, new ClientExecReturn<TDelegationToken,Client>() {
-        @Override
-        public TDelegationToken execute(Client client) throws Exception {
-          return client.getDelegationToken(Tracer.traceInfo(), context.rpcCreds(), tConfig);
-        }
-      });
+      thriftToken = MasterClient.execute(context,
+          client -> client.getDelegationToken(Tracer.traceInfo(), context.rpcCreds(), tConfig));
     } catch (TableNotFoundException e) {
       // should never happen
       throw new AssertionError(
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
index 3d6a4fd683..1f33e3ab4e 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
@@ -80,7 +80,6 @@
 import org.apache.accumulo.core.client.admin.TableOperations;
 import org.apache.accumulo.core.client.admin.TimeType;
 import org.apache.accumulo.core.client.impl.TabletLocator.TabletLocation;
-import org.apache.accumulo.core.client.impl.thrift.ClientService;
 import org.apache.accumulo.core.client.impl.thrift.ClientService.Client;
 import org.apache.accumulo.core.client.impl.thrift.TDiskUsage;
 import org.apache.accumulo.core.client.impl.thrift.ThriftNotActiveServiceException;
@@ -966,13 +965,8 @@ public void setProperty(final String tableName, final String property, final Str
     checkArgument(property != null, "property is null");
     checkArgument(value != null, "value is null");
     try {
-      MasterClient.executeTable(context, new ClientExec<MasterClientService.Client>() {
-        @Override
-        public void execute(MasterClientService.Client client) throws Exception {
-          client.setTableProperty(Tracer.traceInfo(), context.rpcCreds(), tableName, property,
-              value);
-        }
-      });
+      MasterClient.executeTable(context, client -> client.setTableProperty(Tracer.traceInfo(),
+          context.rpcCreds(), tableName, property, value));
     } catch (TableNotFoundException e) {
       throw new AccumuloException(e);
     }
@@ -984,12 +978,8 @@ public void removeProperty(final String tableName, final String property)
     checkArgument(tableName != null, "tableName is null");
     checkArgument(property != null, "property is null");
     try {
-      MasterClient.executeTable(context, new ClientExec<MasterClientService.Client>() {
-        @Override
-        public void execute(MasterClientService.Client client) throws Exception {
-          client.removeTableProperty(Tracer.traceInfo(), context.rpcCreds(), tableName, property);
-        }
-      });
+      MasterClient.executeTable(context, client -> client.removeTableProperty(Tracer.traceInfo(),
+          context.rpcCreds(), tableName, property));
     } catch (TableNotFoundException e) {
       throw new AccumuloException(e);
     }
@@ -1000,14 +990,9 @@ public void execute(MasterClientService.Client client) throws Exception {
       throws AccumuloException, TableNotFoundException {
     checkArgument(tableName != null, "tableName is null");
     try {
-      return ServerClient
-          .executeRaw(context, new ClientExecReturn<Map<String,String>,ClientService.Client>() {
-            @Override
-            public Map<String,String> execute(ClientService.Client client) throws Exception {
-              return client.getTableConfiguration(Tracer.traceInfo(), context.rpcCreds(),
-                  tableName);
-            }
-          }).entrySet();
+      return ServerClient.executeRaw(context,
+          client -> client.getTableConfiguration(Tracer.traceInfo(), context.rpcCreds(), tableName))
+          .entrySet();
     } catch (ThriftTableOperationException e) {
       switch (e.getType()) {
         case NOTFOUND:
@@ -1582,13 +1567,8 @@ public boolean testClassLoad(final String tableName, final String className,
     checkArgument(asTypeName != null, "asTypeName is null");
 
     try {
-      return ServerClient.executeRaw(context, new ClientExecReturn<Boolean,ClientService.Client>() {
-        @Override
-        public Boolean execute(ClientService.Client client) throws Exception {
-          return client.checkTableClass(Tracer.traceInfo(), context.rpcCreds(), tableName,
-              className, asTypeName);
-        }
-      });
+      return ServerClient.executeRaw(context, client -> client.checkTableClass(Tracer.traceInfo(),
+          context.rpcCreds(), tableName, className, asTypeName));
     } catch (ThriftTableOperationException e) {
       switch (e.getType()) {
         case NOTFOUND:
diff --git a/core/src/main/java/org/apache/accumulo/core/rpc/UGIAssumingTransport.java b/core/src/main/java/org/apache/accumulo/core/rpc/UGIAssumingTransport.java
index 20f43983ef..0ca77f2174 100644
--- a/core/src/main/java/org/apache/accumulo/core/rpc/UGIAssumingTransport.java
+++ b/core/src/main/java/org/apache/accumulo/core/rpc/UGIAssumingTransport.java
@@ -48,16 +48,13 @@ public UGIAssumingTransport(TTransport wrapped, UserGroupInformation ugi) {
   public void open() throws TTransportException {
     final AtomicReference<TTransportException> holder = new AtomicReference<>(null);
     try {
-      ugi.doAs(new PrivilegedExceptionAction<Void>() {
-        @Override
-        public Void run() {
-          try {
-            getWrapped().open();
-          } catch (TTransportException tte) {
-            holder.set(tte);
-          }
-          return null;
+      ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+        try {
+          getWrapped().open();
+        } catch (TTransportException tte) {
+          holder.set(tte);
         }
+        return null;
       });
     } catch (IOException | InterruptedException e) {
       throw new RuntimeException(e);
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java b/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
index 72225bbb58..4436f08fa1 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
@@ -42,13 +42,11 @@
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.admin.InstanceOperations;
 import org.apache.accumulo.core.client.impl.ClientContext;
-import org.apache.accumulo.core.client.impl.ClientExec;
 import org.apache.accumulo.core.client.impl.MasterClient;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.DefaultConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.conf.SiteConfiguration;
-import org.apache.accumulo.core.master.thrift.MasterClientService;
 import org.apache.accumulo.core.metadata.MetadataTable;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.NamespacePermission;
@@ -365,12 +363,8 @@ public void run() {
 
   private static void stopServer(final ClientContext context, final boolean tabletServersToo)
       throws AccumuloException, AccumuloSecurityException {
-    MasterClient.executeVoid(context, new ClientExec<MasterClientService.Client>() {
-      @Override
-      public void execute(MasterClientService.Client client) throws Exception {
-        client.shutdown(Tracer.traceInfo(), context.rpcCreds(), tabletServersToo);
-      }
-    });
+    MasterClient.executeVoid(context,
+        client -> client.shutdown(Tracer.traceInfo(), context.rpcCreds(), tabletServersToo));
   }
 
   private static void stopTabletServer(final ClientContext context, List<String> servers,
@@ -389,12 +383,8 @@ private static void stopTabletServer(final ClientContext context, List<String> s
         final String finalServer = qualifyWithZooKeeperSessionId(zTServerRoot, zc,
             address.toString());
         log.info("Stopping server {}", finalServer);
-        MasterClient.executeVoid(context, new ClientExec<MasterClientService.Client>() {
-          @Override
-          public void execute(MasterClientService.Client client) throws Exception {
-            client.shutdownTabletServer(Tracer.traceInfo(), context.rpcCreds(), finalServer, force);
-          }
-        });
+        MasterClient.executeVoid(context, client -> client.shutdownTabletServer(Tracer.traceInfo(),
+            context.rpcCreds(), finalServer, force));
       }
     }
   }
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java
index 4185a4acb4..cfc902f01e 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java
@@ -335,18 +335,13 @@ private void parseSpans(Scanner scanner, Map<String,RecentTracesInformation> sum
     Scanner scanner;
     if (null != traceUgi) {
       try {
-        scanner = traceUgi.doAs(new PrivilegedExceptionAction<Scanner>() {
-
-          @Override
-          public Scanner run() throws Exception {
-            // Make the KerberosToken inside the doAs
-            AuthenticationToken token = at;
-            if (null == token) {
-              token = new KerberosToken();
-            }
-            return getScanner(table, principal, token);
+        scanner = traceUgi.doAs((PrivilegedExceptionAction<Scanner>) () -> {
+          // Make the KerberosToken inside the doAs
+          AuthenticationToken token = at;
+          if (null == token) {
+            token = new KerberosToken();
           }
-
+          return getScanner(table, principal, token);
         });
       } catch (IOException | InterruptedException e) {
         throw new RuntimeException("Failed to obtain scanner", e);
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 5291ac095b..fa5ffc4287 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -3321,12 +3321,9 @@ public static void main(String[] args) throws IOException {
       DistributedTrace.enable(hostname, app, conf.getSystemConfiguration());
       if (UserGroupInformation.isSecurityEnabled()) {
         UserGroupInformation loginUser = UserGroupInformation.getLoginUser();
-        loginUser.doAs(new PrivilegedExceptionAction<Void>() {
-          @Override
-          public Void run() {
-            server.run();
-            return null;
-          }
+        loginUser.doAs((PrivilegedExceptionAction<Void>) () -> {
+          server.run();
+          return null;
         });
       } else {
         server.run();
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
index b8eb7f383e..3f9fc62e61 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
@@ -54,7 +54,6 @@
 import org.apache.accumulo.core.protobuf.ProtobufUtil;
 import org.apache.accumulo.core.replication.ReplicationTarget;
 import org.apache.accumulo.core.replication.thrift.KeyValues;
-import org.apache.accumulo.core.replication.thrift.ReplicationCoordinator;
 import org.apache.accumulo.core.replication.thrift.ReplicationServicer;
 import org.apache.accumulo.core.replication.thrift.ReplicationServicer.Client;
 import org.apache.accumulo.core.replication.thrift.WalEdits;
@@ -260,14 +259,7 @@ private Status _replicate(final Path p, final Status status, final ReplicationTa
         try {
           // Ask the master on the remote what TServer we should talk with to replicate the data
           peerTserverStr = ReplicationClient.executeCoordinatorWithReturn(peerContext,
-              new ClientExecReturn<String,ReplicationCoordinator.Client>() {
-
-                @Override
-                public String execute(ReplicationCoordinator.Client client) throws Exception {
-                  return client.getServicerAddress(remoteTableId, peerContext.rpcCreds());
-                }
-
-              });
+              client -> client.getServicerAddress(remoteTableId, peerContext.rpcCreds()));
         } catch (AccumuloException | AccumuloSecurityException e) {
           // No progress is made
           log.error(
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java b/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java
index 01712af00e..cae251b8c2 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java
@@ -161,24 +161,21 @@ public void testAdminUser() throws Exception {
     // Login as the client (provided to `accumulo init` as the "root" user)
     UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(
         rootUser.getPrincipal(), rootUser.getKeytab().getAbsolutePath());
-    ugi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        final Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
-
-        // The "root" user should have all system permissions
-        for (SystemPermission perm : SystemPermission.values()) {
-          assertTrue("Expected user to have permission: " + perm,
-              conn.securityOperations().hasSystemPermission(conn.whoami(), perm));
-        }
-
-        // and the ability to modify the root and metadata tables
-        for (String table : Arrays.asList(RootTable.NAME, MetadataTable.NAME)) {
-          assertTrue(conn.securityOperations().hasTablePermission(conn.whoami(), table,
-              TablePermission.ALTER_TABLE));
-        }
-        return null;
+    ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      final Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
+
+      // The "root" user should have all system permissions
+      for (SystemPermission perm : SystemPermission.values()) {
+        assertTrue("Expected user to have permission: " + perm,
+            conn.securityOperations().hasSystemPermission(conn.whoami(), perm));
       }
+
+      // and the ability to modify the root and metadata tables
+      for (String table : Arrays.asList(RootTable.NAME, MetadataTable.NAME)) {
+        assertTrue(conn.securityOperations().hasTablePermission(conn.whoami(), table,
+            TablePermission.ALTER_TABLE));
+      }
+      return null;
     });
   }
 
@@ -201,44 +198,37 @@ public void testNewUser() throws Exception {
         rootUser.getPrincipal(), rootUser.getKeytab().getAbsolutePath());
     log.info("Logged in as {}", rootUser.getPrincipal());
 
-    ugi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
-        log.info("Created connector as {}", rootUser.getPrincipal());
-        assertEquals(rootUser.getPrincipal(), conn.whoami());
+    ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
+      log.info("Created connector as {}", rootUser.getPrincipal());
+      assertEquals(rootUser.getPrincipal(), conn.whoami());
 
-        // Make sure the system user doesn't exist -- this will force some RPC to happen server-side
-        createTableWithDataAndCompact(conn);
+      // Make sure the system user doesn't exist -- this will force some RPC to happen server-side
+      createTableWithDataAndCompact(conn);
 
-        assertEquals(users, conn.securityOperations().listLocalUsers());
+      assertEquals(users, conn.securityOperations().listLocalUsers());
 
-        return null;
-      }
+      return null;
     });
     // Switch to a new user
     ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(newQualifiedUser,
         newUserKeytab.getAbsolutePath());
     log.info("Logged in as {}", newQualifiedUser);
-    ugi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        Connector conn = mac.getConnector(newQualifiedUser, new KerberosToken());
-        log.info("Created connector as {}", newQualifiedUser);
-        assertEquals(newQualifiedUser, conn.whoami());
-
-        // The new user should have no system permissions
-        for (SystemPermission perm : SystemPermission.values()) {
-          assertFalse(conn.securityOperations().hasSystemPermission(newQualifiedUser, perm));
-        }
-
-        users.add(newQualifiedUser);
-
-        // Same users as before, plus the new user we just created
-        assertEquals(users, conn.securityOperations().listLocalUsers());
-        return null;
+    ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      Connector conn = mac.getConnector(newQualifiedUser, new KerberosToken());
+      log.info("Created connector as {}", newQualifiedUser);
+      assertEquals(newQualifiedUser, conn.whoami());
+
+      // The new user should have no system permissions
+      for (SystemPermission perm : SystemPermission.values()) {
+        assertFalse(conn.securityOperations().hasSystemPermission(newQualifiedUser, perm));
       }
 
+      users.add(newQualifiedUser);
+
+      // Same users as before, plus the new user we just created
+      assertEquals(users, conn.securityOperations().listLocalUsers());
+      return null;
     });
   }
 
@@ -259,56 +249,47 @@ public void testUserPrivilegesThroughGrant() throws Exception {
     UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(user1,
         user1Keytab.getAbsolutePath());
     log.info("Logged in as {}", user1);
-    ugi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        // Indirectly creates this user when we use it
-        Connector conn = mac.getConnector(qualifiedUser1, new KerberosToken());
-        log.info("Created connector as {}", qualifiedUser1);
-
-        // The new user should have no system permissions
-        for (SystemPermission perm : SystemPermission.values()) {
-          assertFalse(conn.securityOperations().hasSystemPermission(qualifiedUser1, perm));
-        }
-
-        return null;
+    ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      // Indirectly creates this user when we use it
+      Connector conn = mac.getConnector(qualifiedUser1, new KerberosToken());
+      log.info("Created connector as {}", qualifiedUser1);
+
+      // The new user should have no system permissions
+      for (SystemPermission perm : SystemPermission.values()) {
+        assertFalse(conn.securityOperations().hasSystemPermission(qualifiedUser1, perm));
       }
+
+      return null;
     });
 
     ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(rootUser.getPrincipal(),
         rootUser.getKeytab().getAbsolutePath());
-    ugi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
-        conn.securityOperations().grantSystemPermission(qualifiedUser1,
-            SystemPermission.CREATE_TABLE);
-        return null;
-      }
+    ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
+      conn.securityOperations().grantSystemPermission(qualifiedUser1,
+          SystemPermission.CREATE_TABLE);
+      return null;
     });
 
     // Switch back to the original user
     ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(user1,
         user1Keytab.getAbsolutePath());
-    ugi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        Connector conn = mac.getConnector(qualifiedUser1, new KerberosToken());
-
-        // Shouldn't throw an exception since we granted the create table permission
-        final String table = testName.getMethodName() + "_user_table";
-        conn.tableOperations().create(table);
-
-        // Make sure we can actually use the table we made
-        BatchWriter bw = conn.createBatchWriter(table, new BatchWriterConfig());
-        Mutation m = new Mutation("a");
-        m.put("b", "c", "d");
-        bw.addMutation(m);
-        bw.close();
-
-        conn.tableOperations().compact(table, new CompactionConfig().setWait(true).setFlush(true));
-        return null;
-      }
+    ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      Connector conn = mac.getConnector(qualifiedUser1, new KerberosToken());
+
+      // Shouldn't throw an exception since we granted the create table permission
+      final String table = testName.getMethodName() + "_user_table";
+      conn.tableOperations().create(table);
+
+      // Make sure we can actually use the table we made
+      BatchWriter bw = conn.createBatchWriter(table, new BatchWriterConfig());
+      Mutation m = new Mutation("a");
+      m.put("b", "c", "d");
+      bw.addMutation(m);
+      bw.close();
+
+      conn.tableOperations().compact(table, new CompactionConfig().setWait(true).setFlush(true));
+      return null;
     });
   }
 
@@ -329,20 +310,16 @@ public void testUserPrivilegesForTable() throws Exception {
     UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(qualifiedUser1,
         user1Keytab.getAbsolutePath());
     log.info("Logged in as {}", user1);
-    ugi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        // Indirectly creates this user when we use it
-        Connector conn = mac.getConnector(qualifiedUser1, new KerberosToken());
-        log.info("Created connector as {}", qualifiedUser1);
-
-        // The new user should have no system permissions
-        for (SystemPermission perm : SystemPermission.values()) {
-          assertFalse(conn.securityOperations().hasSystemPermission(qualifiedUser1, perm));
-        }
-        return null;
+    ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      // Indirectly creates this user when we use it
+      Connector conn = mac.getConnector(qualifiedUser1, new KerberosToken());
+      log.info("Created connector as {}", qualifiedUser1);
+
+      // The new user should have no system permissions
+      for (SystemPermission perm : SystemPermission.values()) {
+        assertFalse(conn.securityOperations().hasSystemPermission(qualifiedUser1, perm));
       }
-
+      return null;
     });
 
     final String table = testName.getMethodName() + "_user_table";
@@ -351,58 +328,51 @@ public Void run() throws Exception {
     ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(rootUser.getPrincipal(),
         rootUser.getKeytab().getAbsolutePath());
 
-    ugi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
-        conn.tableOperations().create(table);
-        // Give our unprivileged user permission on the table we made for them
-        conn.securityOperations().grantTablePermission(qualifiedUser1, table, TablePermission.READ);
-        conn.securityOperations().grantTablePermission(qualifiedUser1, table,
-            TablePermission.WRITE);
-        conn.securityOperations().grantTablePermission(qualifiedUser1, table,
-            TablePermission.ALTER_TABLE);
-        conn.securityOperations().grantTablePermission(qualifiedUser1, table,
-            TablePermission.DROP_TABLE);
-        conn.securityOperations().changeUserAuthorizations(qualifiedUser1, new Authorizations(viz));
-        return null;
-      }
+    ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
+      conn.tableOperations().create(table);
+      // Give our unprivileged user permission on the table we made for them
+      conn.securityOperations().grantTablePermission(qualifiedUser1, table, TablePermission.READ);
+      conn.securityOperations().grantTablePermission(qualifiedUser1, table, TablePermission.WRITE);
+      conn.securityOperations().grantTablePermission(qualifiedUser1, table,
+          TablePermission.ALTER_TABLE);
+      conn.securityOperations().grantTablePermission(qualifiedUser1, table,
+          TablePermission.DROP_TABLE);
+      conn.securityOperations().changeUserAuthorizations(qualifiedUser1, new Authorizations(viz));
+      return null;
     });
 
     // Switch back to the original user
     ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(qualifiedUser1,
         user1Keytab.getAbsolutePath());
-    ugi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        Connector conn = mac.getConnector(qualifiedUser1, new KerberosToken());
-
-        // Make sure we can actually use the table we made
-
-        // Write data
-        final long ts = 1000L;
-        BatchWriter bw = conn.createBatchWriter(table, new BatchWriterConfig());
-        Mutation m = new Mutation("a");
-        m.put("b", "c", new ColumnVisibility(viz.getBytes()), ts, "d");
-        bw.addMutation(m);
-        bw.close();
-
-        // Compact
-        conn.tableOperations().compact(table, new CompactionConfig().setWait(true).setFlush(true));
-
-        // Alter
-        conn.tableOperations().setProperty(table, Property.TABLE_BLOOM_ENABLED.getKey(), "true");
-
-        // Read (and proper authorizations)
-        try (Scanner s = conn.createScanner(table, new Authorizations(viz))) {
-          Iterator<Entry<Key,Value>> iter = s.iterator();
-          assertTrue("No results from iterator", iter.hasNext());
-          Entry<Key,Value> entry = iter.next();
-          assertEquals(new Key("a", "b", "c", viz, ts), entry.getKey());
-          assertEquals(new Value("d".getBytes()), entry.getValue());
-          assertFalse("Had more results from iterator", iter.hasNext());
-          return null;
-        }
+    ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      Connector conn = mac.getConnector(qualifiedUser1, new KerberosToken());
+
+      // Make sure we can actually use the table we made
+
+      // Write data
+      final long ts = 1000L;
+      BatchWriter bw = conn.createBatchWriter(table, new BatchWriterConfig());
+      Mutation m = new Mutation("a");
+      m.put("b", "c", new ColumnVisibility(viz.getBytes()), ts, "d");
+      bw.addMutation(m);
+      bw.close();
+
+      // Compact
+      conn.tableOperations().compact(table, new CompactionConfig().setWait(true).setFlush(true));
+
+      // Alter
+      conn.tableOperations().setProperty(table, Property.TABLE_BLOOM_ENABLED.getKey(), "true");
+
+      // Read (and proper authorizations)
+      try (Scanner s = conn.createScanner(table, new Authorizations(viz))) {
+        Iterator<Entry<Key,Value>> iter = s.iterator();
+        assertTrue("No results from iterator", iter.hasNext());
+        Entry<Key,Value> entry = iter.next();
+        assertEquals(new Key("a", "b", "c", viz, ts), entry.getKey());
+        assertEquals(new Value("d".getBytes()), entry.getValue());
+        assertFalse("Had more results from iterator", iter.hasNext());
+        return null;
       }
     });
   }
@@ -420,42 +390,36 @@ public void testDelegationToken() throws Exception {
 
     // As the "root" user, open up the connection and get a delegation token
     final AuthenticationToken delegationToken = root
-        .doAs(new PrivilegedExceptionAction<AuthenticationToken>() {
-          @Override
-          public AuthenticationToken run() throws Exception {
-            Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
-            log.info("Created connector as {}", rootUser.getPrincipal());
-            assertEquals(rootUser.getPrincipal(), conn.whoami());
-
-            conn.tableOperations().create(tableName);
-            BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig());
-            for (int r = 0; r < numRows; r++) {
-              Mutation m = new Mutation(Integer.toString(r));
-              for (int c = 0; c < numColumns; c++) {
-                String col = Integer.toString(c);
-                m.put(col, col, col);
-              }
-              bw.addMutation(m);
-            }
-            bw.close();
+        .doAs((PrivilegedExceptionAction<AuthenticationToken>) () -> {
+          Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
+          log.info("Created connector as {}", rootUser.getPrincipal());
+          assertEquals(rootUser.getPrincipal(), conn.whoami());
 
-            return conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
+          conn.tableOperations().create(tableName);
+          BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig());
+          for (int r = 0; r < numRows; r++) {
+            Mutation m = new Mutation(Integer.toString(r));
+            for (int c = 0; c < numColumns; c++) {
+              String col = Integer.toString(c);
+              m.put(col, col, col);
+            }
+            bw.addMutation(m);
           }
+          bw.close();
+
+          return conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
         });
 
     // The above login with keytab doesn't have a way to logout, so make a fake user that won't have
     // krb credentials
     UserGroupInformation userWithoutPrivs = UserGroupInformation.createUserForTesting("fake_user",
         new String[0]);
-    int recordsSeen = userWithoutPrivs.doAs(new PrivilegedExceptionAction<Integer>() {
-      @Override
-      public Integer run() throws Exception {
-        Connector conn = mac.getConnector(rootUser.getPrincipal(), delegationToken);
-
-        try (BatchScanner bs = conn.createBatchScanner(tableName, Authorizations.EMPTY, 2)) {
-          bs.setRanges(Collections.singleton(new Range()));
-          return Iterables.size(bs);
-        }
+    int recordsSeen = userWithoutPrivs.doAs((PrivilegedExceptionAction<Integer>) () -> {
+      Connector conn = mac.getConnector(rootUser.getPrincipal(), delegationToken);
+
+      try (BatchScanner bs = conn.createBatchScanner(tableName, Authorizations.EMPTY, 2)) {
+        bs.setRanges(Collections.singleton(new Range()));
+        return Iterables.size(bs);
       }
     });
 
@@ -471,15 +435,12 @@ public void testDelegationTokenAsDifferentUser() throws Exception {
 
     final AuthenticationToken delegationToken;
     try {
-      delegationToken = ugi.doAs(new PrivilegedExceptionAction<AuthenticationToken>() {
-        @Override
-        public AuthenticationToken run() throws Exception {
-          // As the "root" user, open up the connection and get a delegation token
-          Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
-          log.info("Created connector as {}", rootUser.getPrincipal());
-          assertEquals(rootUser.getPrincipal(), conn.whoami());
-          return conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
-        }
+      delegationToken = ugi.doAs((PrivilegedExceptionAction<AuthenticationToken>) () -> {
+        // As the "root" user, open up the connection and get a delegation token
+        Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
+        log.info("Created connector as {}", rootUser.getPrincipal());
+        assertEquals(rootUser.getPrincipal(), conn.whoami());
+        return conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
       });
     } catch (UndeclaredThrowableException ex) {
       throw ex;
@@ -490,12 +451,9 @@ public AuthenticationToken run() throws Exception {
         new String[0]);
     try {
       // Use the delegation token to try to log in as a different user
-      userWithoutPrivs.doAs(new PrivilegedExceptionAction<Void>() {
-        @Override
-        public Void run() throws Exception {
-          mac.getConnector("some_other_user", delegationToken);
-          return null;
-        }
+      userWithoutPrivs.doAs((PrivilegedExceptionAction<Void>) () -> {
+        mac.getConnector("some_other_user", delegationToken);
+        return null;
       });
       fail("Using a delegation token as a different user should throw an exception");
     } catch (UndeclaredThrowableException e) {
@@ -525,17 +483,14 @@ public void testGetDelegationTokenDenied() throws Exception {
     UserGroupInformation ugi = UserGroupInformation
         .loginUserFromKeytabAndReturnUGI(qualifiedNewUser, newUserKeytab.getAbsolutePath());
     try {
-      ugi.doAs(new PrivilegedExceptionAction<Void>() {
-        @Override
-        public Void run() throws Exception {
-          // As the "root" user, open up the connection and get a delegation token
-          Connector conn = mac.getConnector(qualifiedNewUser, new KerberosToken());
-          log.info("Created connector as {}", qualifiedNewUser);
-          assertEquals(qualifiedNewUser, conn.whoami());
-
-          conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
-          return null;
-        }
+      ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+        // As the "root" user, open up the connection and get a delegation token
+        Connector conn = mac.getConnector(qualifiedNewUser, new KerberosToken());
+        log.info("Created connector as {}", qualifiedNewUser);
+        assertEquals(qualifiedNewUser, conn.whoami());
+
+        conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
+        return null;
       });
     } catch (UndeclaredThrowableException ex) {
       assertTrue(ex.getCause() instanceof AccumuloSecurityException);
@@ -551,21 +506,18 @@ public void testRestartedMasterReusesSecretKey() throws Exception {
 
     // As the "root" user, open up the connection and get a delegation token
     final AuthenticationToken delegationToken1 = root
-        .doAs(new PrivilegedExceptionAction<AuthenticationToken>() {
-          @Override
-          public AuthenticationToken run() throws Exception {
-            Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
-            log.info("Created connector as {}", rootUser.getPrincipal());
-            assertEquals(rootUser.getPrincipal(), conn.whoami());
+        .doAs((PrivilegedExceptionAction<AuthenticationToken>) () -> {
+          Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
+          log.info("Created connector as {}", rootUser.getPrincipal());
+          assertEquals(rootUser.getPrincipal(), conn.whoami());
 
-            AuthenticationToken token = conn.securityOperations()
-                .getDelegationToken(new DelegationTokenConfig());
+          AuthenticationToken token = conn.securityOperations()
+              .getDelegationToken(new DelegationTokenConfig());
 
-            assertTrue("Could not get tables with delegation token", mac
-                .getConnector(rootUser.getPrincipal(), token).tableOperations().list().size() > 0);
+          assertTrue("Could not get tables with delegation token",
+              mac.getConnector(rootUser.getPrincipal(), token).tableOperations().list().size() > 0);
 
-            return token;
-          }
+          return token;
         });
 
     log.info("Stopping master");
@@ -575,35 +527,29 @@ public AuthenticationToken run() throws Exception {
     mac.getClusterControl().start(ServerType.MASTER);
 
     // Make sure our original token is still good
-    root.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        Connector conn = mac.getConnector(rootUser.getPrincipal(), delegationToken1);
+    root.doAs((PrivilegedExceptionAction<Void>) () -> {
+      Connector conn = mac.getConnector(rootUser.getPrincipal(), delegationToken1);
 
-        assertTrue("Could not get tables with delegation token",
-            conn.tableOperations().list().size() > 0);
+      assertTrue("Could not get tables with delegation token",
+          conn.tableOperations().list().size() > 0);
 
-        return null;
-      }
+      return null;
     });
 
     // Get a new token, so we can compare the keyId on the second to the first
     final AuthenticationToken delegationToken2 = root
-        .doAs(new PrivilegedExceptionAction<AuthenticationToken>() {
-          @Override
-          public AuthenticationToken run() throws Exception {
-            Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
-            log.info("Created connector as {}", rootUser.getPrincipal());
-            assertEquals(rootUser.getPrincipal(), conn.whoami());
+        .doAs((PrivilegedExceptionAction<AuthenticationToken>) () -> {
+          Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
+          log.info("Created connector as {}", rootUser.getPrincipal());
+          assertEquals(rootUser.getPrincipal(), conn.whoami());
 
-            AuthenticationToken token = conn.securityOperations()
-                .getDelegationToken(new DelegationTokenConfig());
+          AuthenticationToken token = conn.securityOperations()
+              .getDelegationToken(new DelegationTokenConfig());
 
-            assertTrue("Could not get tables with delegation token", mac
-                .getConnector(rootUser.getPrincipal(), token).tableOperations().list().size() > 0);
+          assertTrue("Could not get tables with delegation token",
+              mac.getConnector(rootUser.getPrincipal(), token).tableOperations().list().size() > 0);
 
-            return token;
-          }
+          return token;
         });
 
     // A restarted master should reuse the same secret key after a restart if the secret key hasn't
@@ -622,17 +568,14 @@ public void testDelegationTokenWithInvalidLifetime() throws Throwable {
 
     // As the "root" user, open up the connection and get a delegation token
     try {
-      root.doAs(new PrivilegedExceptionAction<AuthenticationToken>() {
-        @Override
-        public AuthenticationToken run() throws Exception {
-          Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
-          log.info("Created connector as {}", rootUser.getPrincipal());
-          assertEquals(rootUser.getPrincipal(), conn.whoami());
+      root.doAs((PrivilegedExceptionAction<AuthenticationToken>) () -> {
+        Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
+        log.info("Created connector as {}", rootUser.getPrincipal());
+        assertEquals(rootUser.getPrincipal(), conn.whoami());
 
-          // Should fail
-          return conn.securityOperations().getDelegationToken(
-              new DelegationTokenConfig().setTokenLifetime(Long.MAX_VALUE, TimeUnit.MILLISECONDS));
-        }
+        // Should fail
+        return conn.securityOperations().getDelegationToken(
+            new DelegationTokenConfig().setTokenLifetime(Long.MAX_VALUE, TimeUnit.MILLISECONDS));
       });
     } catch (UndeclaredThrowableException e) {
       Throwable cause = e.getCause();
@@ -652,17 +595,15 @@ public void testDelegationTokenWithReducedLifetime() throws Throwable {
     log.info("Logged in as {}", rootUser.getPrincipal());
 
     // As the "root" user, open up the connection and get a delegation token
-    final AuthenticationToken dt = root.doAs(new PrivilegedExceptionAction<AuthenticationToken>() {
-      @Override
-      public AuthenticationToken run() throws Exception {
-        Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
-        log.info("Created connector as {}", rootUser.getPrincipal());
-        assertEquals(rootUser.getPrincipal(), conn.whoami());
+    final AuthenticationToken dt = root
+        .doAs((PrivilegedExceptionAction<AuthenticationToken>) () -> {
+          Connector conn = mac.getConnector(rootUser.getPrincipal(), new KerberosToken());
+          log.info("Created connector as {}", rootUser.getPrincipal());
+          assertEquals(rootUser.getPrincipal(), conn.whoami());
 
-        return conn.securityOperations()
-            .getDelegationToken(new DelegationTokenConfig().setTokenLifetime(5, TimeUnit.MINUTES));
-      }
-    });
+          return conn.securityOperations().getDelegationToken(
+              new DelegationTokenConfig().setTokenLifetime(5, TimeUnit.MINUTES));
+        });
 
     AuthenticationTokenIdentifier identifier = ((DelegationTokenImpl) dt).getIdentifier();
     assertTrue("Expected identifier to expire in no more than 5 minutes: " + identifier,
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/KerberosProxyIT.java b/test/src/main/java/org/apache/accumulo/test/functional/KerberosProxyIT.java
index 723171c4a4..c17fb4523e 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/KerberosProxyIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/KerberosProxyIT.java
@@ -542,81 +542,66 @@ public void proxiedUserAccessWithoutAccumuloProxy() throws Exception {
         .createProxyUser(userWithoutCredentials3, realUgi);
 
     // Create a table and user, grant permission to our user to read that table.
-    rootUgi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        Connector conn = mac.getConnector(rootUgi.getUserName(), new KerberosToken());
-        conn.tableOperations().create(tableName);
-        conn.securityOperations().createLocalUser(userWithoutCredentials1,
-            new PasswordToken("ignored"));
-        conn.securityOperations().grantTablePermission(userWithoutCredentials1, tableName,
-            TablePermission.READ);
-        conn.securityOperations().createLocalUser(userWithoutCredentials3,
-            new PasswordToken("ignored"));
-        conn.securityOperations().grantTablePermission(userWithoutCredentials3, tableName,
-            TablePermission.READ);
-        return null;
-      }
+    rootUgi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      Connector conn = mac.getConnector(rootUgi.getUserName(), new KerberosToken());
+      conn.tableOperations().create(tableName);
+      conn.securityOperations().createLocalUser(userWithoutCredentials1,
+          new PasswordToken("ignored"));
+      conn.securityOperations().grantTablePermission(userWithoutCredentials1, tableName,
+          TablePermission.READ);
+      conn.securityOperations().createLocalUser(userWithoutCredentials3,
+          new PasswordToken("ignored"));
+      conn.securityOperations().grantTablePermission(userWithoutCredentials3, tableName,
+          TablePermission.READ);
+      return null;
     });
-    realUgi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        Connector conn = mac.getConnector(proxyPrincipal, new KerberosToken());
-        try (Scanner s = conn.createScanner(tableName, Authorizations.EMPTY)) {
-          s.iterator().hasNext();
-          Assert.fail("Expected to see an exception");
-        } catch (RuntimeException e) {
-          int numSecurityExceptionsSeen = Iterables
-              .size(Iterables.filter(Throwables.getCausalChain(e),
-                  org.apache.accumulo.core.client.AccumuloSecurityException.class));
-          assertTrue("Expected to see at least one AccumuloSecurityException, but saw: "
-              + Throwables.getStackTraceAsString(e), numSecurityExceptionsSeen > 0);
-        }
-        return null;
+    realUgi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      Connector conn = mac.getConnector(proxyPrincipal, new KerberosToken());
+      try (Scanner s = conn.createScanner(tableName, Authorizations.EMPTY)) {
+        s.iterator().hasNext();
+        Assert.fail("Expected to see an exception");
+      } catch (RuntimeException e) {
+        int numSecurityExceptionsSeen = Iterables
+            .size(Iterables.filter(Throwables.getCausalChain(e),
+                org.apache.accumulo.core.client.AccumuloSecurityException.class));
+        assertTrue("Expected to see at least one AccumuloSecurityException, but saw: "
+            + Throwables.getStackTraceAsString(e), numSecurityExceptionsSeen > 0);
       }
+      return null;
     });
     // Allowed to be proxied and has read permission
-    proxyUser1.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        Connector conn = mac.getConnector(userWithoutCredentials1,
-            new KerberosToken(userWithoutCredentials1));
-        Scanner s = conn.createScanner(tableName, Authorizations.EMPTY);
-        assertFalse(s.iterator().hasNext());
-        return null;
-      }
+    proxyUser1.doAs((PrivilegedExceptionAction<Void>) () -> {
+      Connector conn = mac.getConnector(userWithoutCredentials1,
+          new KerberosToken(userWithoutCredentials1));
+      Scanner s = conn.createScanner(tableName, Authorizations.EMPTY);
+      assertFalse(s.iterator().hasNext());
+      return null;
     });
     // Allowed to be proxied but does not have read permission
-    proxyUser2.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        Connector conn = mac.getConnector(userWithoutCredentials2,
-            new KerberosToken(userWithoutCredentials3));
-        try (Scanner s = conn.createScanner(tableName, Authorizations.EMPTY)) {
-          s.iterator().hasNext();
-          Assert.fail("Expected to see an exception");
-        } catch (RuntimeException e) {
-          int numSecurityExceptionsSeen = Iterables
-              .size(Iterables.filter(Throwables.getCausalChain(e),
-                  org.apache.accumulo.core.client.AccumuloSecurityException.class));
-          assertTrue("Expected to see at least one AccumuloSecurityException, but saw: "
-              + Throwables.getStackTraceAsString(e), numSecurityExceptionsSeen > 0);
-        }
-        return null;
+    proxyUser2.doAs((PrivilegedExceptionAction<Void>) () -> {
+      Connector conn = mac.getConnector(userWithoutCredentials2,
+          new KerberosToken(userWithoutCredentials3));
+      try (Scanner s = conn.createScanner(tableName, Authorizations.EMPTY)) {
+        s.iterator().hasNext();
+        Assert.fail("Expected to see an exception");
+      } catch (RuntimeException e) {
+        int numSecurityExceptionsSeen = Iterables
+            .size(Iterables.filter(Throwables.getCausalChain(e),
+                org.apache.accumulo.core.client.AccumuloSecurityException.class));
+        assertTrue("Expected to see at least one AccumuloSecurityException, but saw: "
+            + Throwables.getStackTraceAsString(e), numSecurityExceptionsSeen > 0);
       }
+      return null;
     });
     // Has read permission but is not allowed to be proxied
-    proxyUser3.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        try {
-          mac.getConnector(userWithoutCredentials3, new KerberosToken(userWithoutCredentials3));
-          Assert.fail("Should not be able to create a Connector as this user cannot be proxied");
-        } catch (org.apache.accumulo.core.client.AccumuloSecurityException e) {
-          // Expected, this user cannot be proxied
-        }
-        return null;
+    proxyUser3.doAs((PrivilegedExceptionAction<Void>) () -> {
+      try {
+        mac.getConnector(userWithoutCredentials3, new KerberosToken(userWithoutCredentials3));
+        Assert.fail("Should not be able to create a Connector as this user cannot be proxied");
+      } catch (org.apache.accumulo.core.client.AccumuloSecurityException e) {
+        // Expected, this user cannot be proxied
       }
+      return null;
     });
   }
 
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 dd951a7aa8..c3d561eeec 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
@@ -40,12 +40,10 @@
 
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.impl.ClientContext;
-import org.apache.accumulo.core.client.impl.ClientExec;
 import org.apache.accumulo.core.client.impl.MasterClient;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.impl.KeyExtent;
-import org.apache.accumulo.core.master.thrift.MasterClientService;
 import org.apache.accumulo.core.util.HostAndPort;
 import org.apache.accumulo.minicluster.ServerType;
 import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
@@ -123,12 +121,9 @@ public void eliminateTabletServers(final ClientContext ctx, TabletLocations locs
 
         for (int i = 0; i < count; ++i) {
           final String tserverName = tserversList.get(i).toString();
-          MasterClient.executeVoid(ctx, new ClientExec<MasterClientService.Client>() {
-            @Override
-            public void execute(MasterClientService.Client client) throws Exception {
-              log.info("Sending shutdown command to {} via MasterClientService", tserverName);
-              client.shutdownTabletServer(null, ctx.rpcCreds(), tserverName, false);
-            }
+          MasterClient.executeVoid(ctx, client -> {
+            log.info("Sending shutdown command to {} via MasterClientService", tserverName);
+            client.shutdownTabletServer(null, ctx.rpcCreds(), tserverName, false);
           });
         }
 
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 8bc8590171..91f5f46dcc 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
@@ -29,7 +29,6 @@
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.impl.ClientContext;
-import org.apache.accumulo.core.client.impl.ClientExecReturn;
 import org.apache.accumulo.core.client.impl.MasterClient;
 import org.apache.accumulo.core.client.impl.Table;
 import org.apache.accumulo.core.conf.Property;
@@ -37,7 +36,6 @@
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.master.thrift.MasterClientService;
 import org.apache.accumulo.core.metadata.MetadataTable;
 import org.apache.accumulo.core.metadata.schema.MetadataSchema;
 import org.apache.accumulo.core.protobuf.ProtobufUtil;
@@ -384,12 +382,7 @@ public void testUnreferencedWalInTserverIsClosed() throws Exception {
     // Get the tservers which the master deems as active
     final ClientContext context = new ClientContext(getConnectionInfo());
     List<String> tservers = MasterClient.execute(context,
-        new ClientExecReturn<List<String>,MasterClientService.Client>() {
-          @Override
-          public List<String> execute(MasterClientService.Client client) throws Exception {
-            return client.getActiveTservers(Tracer.traceInfo(), context.rpcCreds());
-          }
-        });
+        client -> client.getActiveTservers(Tracer.traceInfo(), context.rpcCreds()));
 
     Assert.assertEquals("Expected only one active tservers", 1, tservers.size());
 
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/KerberosReplicationIT.java b/test/src/main/java/org/apache/accumulo/test/replication/KerberosReplicationIT.java
index 1eb27ec33e..e2b4f165c1 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/KerberosReplicationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/KerberosReplicationIT.java
@@ -158,99 +158,95 @@ public void dataReplicatedToCorrectTable() throws Exception {
     // Login as the root user
     final UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(
         rootUser.getPrincipal(), rootUser.getKeytab().toURI().toString());
-    ugi.doAs(new PrivilegedExceptionAction<Void>() {
-      @Override
-      public Void run() throws Exception {
-        log.info("testing {}", ugi);
-        final KerberosToken token = new KerberosToken();
-        final Connector primaryConn = primary.getConnector(rootUser.getPrincipal(), token);
-        final Connector peerConn = peer.getConnector(rootUser.getPrincipal(), token);
-
-        ClusterUser replicationUser = kdc.getClientPrincipal(0);
-
-        // Create user for replication to the peer
-        peerConn.securityOperations().createLocalUser(replicationUser.getPrincipal(), null);
-
-        primaryConn.instanceOperations().setProperty(
-            Property.REPLICATION_PEER_USER.getKey() + PEER_NAME, replicationUser.getPrincipal());
-        primaryConn.instanceOperations().setProperty(
-            Property.REPLICATION_PEER_KEYTAB.getKey() + PEER_NAME,
-            replicationUser.getKeytab().getAbsolutePath());
-
-        // ...peer = AccumuloReplicaSystem,instanceName,zookeepers
-        primaryConn.instanceOperations().setProperty(
-            Property.REPLICATION_PEERS.getKey() + PEER_NAME,
-            ReplicaSystemFactory.getPeerConfigurationValue(AccumuloReplicaSystem.class,
-                AccumuloReplicaSystem.buildConfiguration(peerConn.getInstance().getInstanceName(),
-                    peerConn.getInstance().getZooKeepers())));
-
-        String primaryTable1 = "primary", peerTable1 = "peer";
-
-        // Create tables
-        primaryConn.tableOperations().create(primaryTable1);
-        String masterTableId1 = primaryConn.tableOperations().tableIdMap().get(primaryTable1);
-        Assert.assertNotNull(masterTableId1);
-
-        peerConn.tableOperations().create(peerTable1);
-        String peerTableId1 = peerConn.tableOperations().tableIdMap().get(peerTable1);
-        Assert.assertNotNull(peerTableId1);
-
-        // Grant write permission
-        peerConn.securityOperations().grantTablePermission(replicationUser.getPrincipal(),
-            peerTable1, TablePermission.WRITE);
-
-        // Replicate this table to the peerClusterName in a table with the peerTableId table id
-        primaryConn.tableOperations().setProperty(primaryTable1,
-            Property.TABLE_REPLICATION.getKey(), "true");
-        primaryConn.tableOperations().setProperty(primaryTable1,
-            Property.TABLE_REPLICATION_TARGET.getKey() + PEER_NAME, peerTableId1);
-
-        // Write some data to table1
-        BatchWriter bw = primaryConn.createBatchWriter(primaryTable1, new BatchWriterConfig());
-        long masterTable1Records = 0L;
-        for (int rows = 0; rows < 2500; rows++) {
-          Mutation m = new Mutation(primaryTable1 + rows);
-          for (int cols = 0; cols < 100; cols++) {
-            String value = Integer.toString(cols);
-            m.put(value, "", value);
-            masterTable1Records++;
-          }
-          bw.addMutation(m);
+    ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
+      log.info("testing {}", ugi);
+      final KerberosToken token = new KerberosToken();
+      final Connector primaryConn = primary.getConnector(rootUser.getPrincipal(), token);
+      final Connector peerConn = peer.getConnector(rootUser.getPrincipal(), token);
+
+      ClusterUser replicationUser = kdc.getClientPrincipal(0);
+
+      // Create user for replication to the peer
+      peerConn.securityOperations().createLocalUser(replicationUser.getPrincipal(), null);
+
+      primaryConn.instanceOperations().setProperty(
+          Property.REPLICATION_PEER_USER.getKey() + PEER_NAME, replicationUser.getPrincipal());
+      primaryConn.instanceOperations().setProperty(
+          Property.REPLICATION_PEER_KEYTAB.getKey() + PEER_NAME,
+          replicationUser.getKeytab().getAbsolutePath());
+
+      // ...peer = AccumuloReplicaSystem,instanceName,zookeepers
+      primaryConn.instanceOperations().setProperty(Property.REPLICATION_PEERS.getKey() + PEER_NAME,
+          ReplicaSystemFactory.getPeerConfigurationValue(AccumuloReplicaSystem.class,
+              AccumuloReplicaSystem.buildConfiguration(peerConn.getInstance().getInstanceName(),
+                  peerConn.getInstance().getZooKeepers())));
+
+      String primaryTable1 = "primary", peerTable1 = "peer";
+
+      // Create tables
+      primaryConn.tableOperations().create(primaryTable1);
+      String masterTableId1 = primaryConn.tableOperations().tableIdMap().get(primaryTable1);
+      Assert.assertNotNull(masterTableId1);
+
+      peerConn.tableOperations().create(peerTable1);
+      String peerTableId1 = peerConn.tableOperations().tableIdMap().get(peerTable1);
+      Assert.assertNotNull(peerTableId1);
+
+      // Grant write permission
+      peerConn.securityOperations().grantTablePermission(replicationUser.getPrincipal(), peerTable1,
+          TablePermission.WRITE);
+
+      // Replicate this table to the peerClusterName in a table with the peerTableId table id
+      primaryConn.tableOperations().setProperty(primaryTable1, Property.TABLE_REPLICATION.getKey(),
+          "true");
+      primaryConn.tableOperations().setProperty(primaryTable1,
+          Property.TABLE_REPLICATION_TARGET.getKey() + PEER_NAME, peerTableId1);
+
+      // Write some data to table1
+      BatchWriter bw = primaryConn.createBatchWriter(primaryTable1, new BatchWriterConfig());
+      long masterTable1Records = 0L;
+      for (int rows = 0; rows < 2500; rows++) {
+        Mutation m = new Mutation(primaryTable1 + rows);
+        for (int cols = 0; cols < 100; cols++) {
+          String value = Integer.toString(cols);
+          m.put(value, "", value);
+          masterTable1Records++;
         }
+        bw.addMutation(m);
+      }
 
-        bw.close();
+      bw.close();
 
-        log.info("Wrote all data to primary cluster");
+      log.info("Wrote all data to primary cluster");
 
-        Set<String> filesFor1 = primaryConn.replicationOperations().referencedFiles(primaryTable1);
+      Set<String> filesFor1 = primaryConn.replicationOperations().referencedFiles(primaryTable1);
 
-        // Restart the tserver to force a close on the WAL
-        for (ProcessReference proc : primary.getProcesses().get(ServerType.TABLET_SERVER)) {
-          primary.killProcess(ServerType.TABLET_SERVER, proc);
-        }
-        primary.exec(TabletServer.class);
+      // Restart the tserver to force a close on the WAL
+      for (ProcessReference proc : primary.getProcesses().get(ServerType.TABLET_SERVER)) {
+        primary.killProcess(ServerType.TABLET_SERVER, proc);
+      }
+      primary.exec(TabletServer.class);
 
-        log.info("Restarted the tserver");
+      log.info("Restarted the tserver");
 
-        // Read the data -- the tserver is back up and running and tablets are assigned
-        Iterators.size(primaryConn.createScanner(primaryTable1, Authorizations.EMPTY).iterator());
+      // Read the data -- the tserver is back up and running and tablets are assigned
+      Iterators.size(primaryConn.createScanner(primaryTable1, Authorizations.EMPTY).iterator());
 
-        // Wait for both tables to be replicated
-        log.info("Waiting for {} for {}", filesFor1, primaryTable1);
-        primaryConn.replicationOperations().drain(primaryTable1, filesFor1);
+      // Wait for both tables to be replicated
+      log.info("Waiting for {} for {}", filesFor1, primaryTable1);
+      primaryConn.replicationOperations().drain(primaryTable1, filesFor1);
 
-        long countTable = 0L;
-        for (Entry<Key,Value> entry : peerConn.createScanner(peerTable1, Authorizations.EMPTY)) {
-          countTable++;
-          Assert.assertTrue("Found unexpected key-value" + entry.getKey().toStringNoTruncate() + " "
-              + entry.getValue(), entry.getKey().getRow().toString().startsWith(primaryTable1));
-        }
+      long countTable = 0L;
+      for (Entry<Key,Value> entry : peerConn.createScanner(peerTable1, Authorizations.EMPTY)) {
+        countTable++;
+        Assert.assertTrue("Found unexpected key-value" + entry.getKey().toStringNoTruncate() + " "
+            + entry.getValue(), entry.getKey().getRow().toString().startsWith(primaryTable1));
+      }
 
-        log.info("Found {} records in {}", countTable, peerTable1);
-        Assert.assertEquals(masterTable1Records, countTable);
+      log.info("Found {} records in {}", countTable, peerTable1);
+      Assert.assertEquals(masterTable1Records, countTable);
 
-        return null;
-      }
+      return null;
     });
   }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services