accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [4/4] accumulo git commit: ACCUMULO-4386 Disambiguate method references
Date Mon, 25 Jul 2016 21:09:56 GMT
ACCUMULO-4386 Disambiguate method references

Rename some internal methods to disambiguate when using new Java 8
method references. Although none of our code is calling these methods
using the new method references (yet), this fixes a java compiler
warning in the build about potential ambiguity if we had tried to
reference them.


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

Branch: refs/heads/master
Commit: ecd345d543e359a2b2ddeb7457401da19e2dff05
Parents: 5b041db
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Mon Jul 25 17:01:34 2016 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Mon Jul 25 17:01:34 2016 -0400

----------------------------------------------------------------------
 .../core/client/impl/ConnectorImpl.java         |  2 +-
 .../client/impl/InstanceOperationsImpl.java     |  6 ++---
 .../accumulo/core/client/impl/MasterClient.java |  2 +-
 .../client/impl/SecurityOperationsImpl.java     | 24 ++++++++++----------
 .../accumulo/core/client/impl/ServerClient.java |  6 ++---
 .../org/apache/accumulo/server/util/Admin.java  |  4 ++--
 .../test/master/SuspendedTabletsIT.java         |  2 +-
 7 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ecd345d5/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
index 7cab204..324e11a 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
@@ -62,7 +62,7 @@ public class ConnectorImpl extends Connector {
     // Skip fail fast for system services; string literal for class name, to avoid dependency
on server jar
     final String tokenClassName = context.getCredentials().getToken().getClass().getName();
     if (!SYSTEM_TOKEN_NAME.equals(tokenClassName)) {
-      ServerClient.execute(context, new ClientExec<ClientService.Client>() {
+      ServerClient.executeVoid(context, new ClientExec<ClientService.Client>() {
         @Override
         public void execute(ClientService.Client iface) throws Exception {
           if (!iface.authenticate(Tracer.traceInfo(), context.rpcCreds()))

http://git-wip-us.apache.org/repos/asf/accumulo/blob/ecd345d5/core/src/main/java/org/apache/accumulo/core/client/impl/InstanceOperationsImpl.java
----------------------------------------------------------------------
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 d716650..9b88473 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
@@ -66,7 +66,7 @@ public class InstanceOperationsImpl implements InstanceOperations {
   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.execute(context, new ClientExec<MasterClientService.Client>() {
+    MasterClient.executeVoid(context, new ClientExec<MasterClientService.Client>()
{
       @Override
       public void execute(MasterClientService.Client client) throws Exception {
         client.setSystemProperty(Tracer.traceInfo(), context.rpcCreds(), property, value);
@@ -77,7 +77,7 @@ public class InstanceOperationsImpl implements InstanceOperations {
   @Override
   public void removeProperty(final String property) throws AccumuloException, AccumuloSecurityException
{
     checkArgument(property != null, "property is null");
-    MasterClient.execute(context, new ClientExec<MasterClientService.Client>() {
+    MasterClient.executeVoid(context, new ClientExec<MasterClientService.Client>()
{
       @Override
       public void execute(MasterClientService.Client client) throws Exception {
         client.removeSystemProperty(Tracer.traceInfo(), context.rpcCreds(), property);
@@ -210,7 +210,7 @@ public class InstanceOperationsImpl implements InstanceOperations {
   @Override
   public void waitForBalance() throws AccumuloException {
     try {
-      MasterClient.execute(context, new ClientExec<MasterClientService.Client>() {
+      MasterClient.executeVoid(context, new ClientExec<MasterClientService.Client>()
{
         @Override
         public void execute(MasterClientService.Client client) throws Exception {
           client.waitForBalance(Tracer.traceInfo());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/ecd345d5/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java b/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
index 73e7f10..894e29a 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
@@ -169,7 +169,7 @@ public class MasterClient {
     }
   }
 
-  public static void execute(ClientContext context, ClientExec<MasterClientService.Client>
exec) throws AccumuloException, AccumuloSecurityException {
+  public static void executeVoid(ClientContext context, ClientExec<MasterClientService.Client>
exec) throws AccumuloException, AccumuloSecurityException {
     try {
       executeGeneric(context, exec);
     } catch (TableNotFoundException e) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/ecd345d5/core/src/main/java/org/apache/accumulo/core/client/impl/SecurityOperationsImpl.java
----------------------------------------------------------------------
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 250254a..6e3d714 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
@@ -48,9 +48,9 @@ public class SecurityOperationsImpl implements SecurityOperations {
 
   private final ClientContext context;
 
-  private void execute(ClientExec<ClientService.Client> exec) throws AccumuloException,
AccumuloSecurityException {
+  private void executeVoid(ClientExec<ClientService.Client> exec) throws AccumuloException,
AccumuloSecurityException {
     try {
-      ServerClient.executeRaw(context, exec);
+      ServerClient.executeRawVoid(context, exec);
     } catch (ThriftTableOperationException ttoe) {
       // recast missing table
       if (ttoe.getType() == TableOperationExceptionType.NOTFOUND)
@@ -99,7 +99,7 @@ public class SecurityOperationsImpl implements SecurityOperations {
     if (null == context.getSaslParams()) {
       checkArgument(password != null, "password is null");
     }
-    execute(new ClientExec<ClientService.Client>() {
+    executeVoid(new ClientExec<ClientService.Client>() {
       @Override
       public void execute(ClientService.Client client) throws Exception {
         if (null == context.getSaslParams()) {
@@ -114,7 +114,7 @@ public class SecurityOperationsImpl implements SecurityOperations {
   @Override
   public void dropLocalUser(final String principal) throws AccumuloException, AccumuloSecurityException
{
     checkArgument(principal != null, "principal is null");
-    execute(new ClientExec<ClientService.Client>() {
+    executeVoid(new ClientExec<ClientService.Client>() {
       @Override
       public void execute(ClientService.Client client) throws Exception {
         client.dropLocalUser(Tracer.traceInfo(), context.rpcCreds(), principal);
@@ -140,7 +140,7 @@ public class SecurityOperationsImpl implements SecurityOperations {
     checkArgument(principal != null, "principal is null");
     checkArgument(token != null, "token is null");
     final Credentials toChange = new Credentials(principal, token);
-    execute(new ClientExec<ClientService.Client>() {
+    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()));
@@ -155,7 +155,7 @@ public class SecurityOperationsImpl implements SecurityOperations {
   public void changeUserAuthorizations(final String principal, final Authorizations authorizations)
throws AccumuloException, AccumuloSecurityException {
     checkArgument(principal != null, "principal is null");
     checkArgument(authorizations != null, "authorizations is null");
-    execute(new ClientExec<ClientService.Client>() {
+    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()));
@@ -224,7 +224,7 @@ public class SecurityOperationsImpl implements SecurityOperations {
   public void grantSystemPermission(final String principal, final SystemPermission permission)
throws AccumuloException, AccumuloSecurityException {
     checkArgument(principal != null, "principal is null");
     checkArgument(permission != null, "permission is null");
-    execute(new ClientExec<ClientService.Client>() {
+    executeVoid(new ClientExec<ClientService.Client>() {
       @Override
       public void execute(ClientService.Client client) throws Exception {
         client.grantSystemPermission(Tracer.traceInfo(), context.rpcCreds(), principal, permission.getId());
@@ -239,7 +239,7 @@ public class SecurityOperationsImpl implements SecurityOperations {
     checkArgument(table != null, "table is null");
     checkArgument(permission != null, "permission is null");
     try {
-      execute(new ClientExec<ClientService.Client>() {
+      executeVoid(new ClientExec<ClientService.Client>() {
         @Override
         public void execute(ClientService.Client client) throws Exception {
           client.grantTablePermission(Tracer.traceInfo(), context.rpcCreds(), principal,
table, permission.getId());
@@ -259,7 +259,7 @@ public class SecurityOperationsImpl implements SecurityOperations {
     checkArgument(principal != null, "principal is null");
     checkArgument(namespace != null, "namespace is null");
     checkArgument(permission != null, "permission is null");
-    execute(new ClientExec<ClientService.Client>() {
+    executeVoid(new ClientExec<ClientService.Client>() {
       @Override
       public void execute(ClientService.Client client) throws Exception {
         client.grantNamespacePermission(Tracer.traceInfo(), context.rpcCreds(), principal,
namespace, permission.getId());
@@ -271,7 +271,7 @@ public class SecurityOperationsImpl implements SecurityOperations {
   public void revokeSystemPermission(final String principal, final SystemPermission permission)
throws AccumuloException, AccumuloSecurityException {
     checkArgument(principal != null, "principal is null");
     checkArgument(permission != null, "permission is null");
-    execute(new ClientExec<ClientService.Client>() {
+    executeVoid(new ClientExec<ClientService.Client>() {
       @Override
       public void execute(ClientService.Client client) throws Exception {
         client.revokeSystemPermission(Tracer.traceInfo(), context.rpcCreds(), principal,
permission.getId());
@@ -286,7 +286,7 @@ public class SecurityOperationsImpl implements SecurityOperations {
     checkArgument(table != null, "table is null");
     checkArgument(permission != null, "permission is null");
     try {
-      execute(new ClientExec<ClientService.Client>() {
+      executeVoid(new ClientExec<ClientService.Client>() {
         @Override
         public void execute(ClientService.Client client) throws Exception {
           client.revokeTablePermission(Tracer.traceInfo(), context.rpcCreds(), principal,
table, permission.getId());
@@ -306,7 +306,7 @@ public class SecurityOperationsImpl implements SecurityOperations {
     checkArgument(principal != null, "principal is null");
     checkArgument(namespace != null, "namespace is null");
     checkArgument(permission != null, "permission is null");
-    execute(new ClientExec<ClientService.Client>() {
+    executeVoid(new ClientExec<ClientService.Client>() {
       @Override
       public void execute(ClientService.Client client) throws Exception {
         client.revokeNamespacePermission(Tracer.traceInfo(), context.rpcCreds(), principal,
namespace, permission.getId());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/ecd345d5/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
index 501b4df..a4853f0 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
@@ -58,9 +58,9 @@ public class ServerClient {
     }
   }
 
-  public static void execute(ClientContext context, ClientExec<ClientService.Client>
exec) throws AccumuloException, AccumuloSecurityException {
+  public static void executeVoid(ClientContext context, ClientExec<ClientService.Client>
exec) throws AccumuloException, AccumuloSecurityException {
     try {
-      executeRaw(context, exec);
+      executeRawVoid(context, exec);
     } catch (ThriftSecurityException e) {
       throw new AccumuloSecurityException(e.user, e.code, e);
     } catch (AccumuloException e) {
@@ -89,7 +89,7 @@ public class ServerClient {
     }
   }
 
-  public static void executeRaw(ClientContext context, ClientExec<ClientService.Client>
exec) throws Exception {
+  public static void executeRawVoid(ClientContext context, ClientExec<ClientService.Client>
exec) throws Exception {
     while (true) {
       ClientService.Client client = null;
       String server = null;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/ecd345d5/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java b/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
index ea2f458..818ddd9 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
@@ -356,7 +356,7 @@ public class Admin implements KeywordExecutable {
   }
 
   private static void stopServer(final ClientContext context, final boolean tabletServersToo)
throws AccumuloException, AccumuloSecurityException {
-    MasterClient.execute(context, new ClientExec<MasterClientService.Client>() {
+    MasterClient.executeVoid(context, new ClientExec<MasterClientService.Client>()
{
       @Override
       public void execute(MasterClientService.Client client) throws Exception {
         client.shutdown(Tracer.traceInfo(), context.rpcCreds(), tabletServersToo);
@@ -378,7 +378,7 @@ public class Admin implements KeywordExecutable {
         HostAndPort address = AddressUtil.parseAddress(server, port);
         final String finalServer = qualifyWithZooKeeperSessionId(zTServerRoot, zc, address.toString());
         log.info("Stopping server " + finalServer);
-        MasterClient.execute(context, new ClientExec<MasterClientService.Client>()
{
+        MasterClient.executeVoid(context, new ClientExec<MasterClientService.Client>()
{
           @Override
           public void execute(MasterClientService.Client client) throws Exception {
             client.shutdownTabletServer(Tracer.traceInfo(), context.rpcCreds(), finalServer,
force);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/ecd345d5/test/src/main/java/org/apache/accumulo/test/master/SuspendedTabletsIT.java
----------------------------------------------------------------------
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 bfd43da..bed0b62 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
@@ -123,7 +123,7 @@ public class SuspendedTabletsIT extends ConfigurableMacBase {
 
         for (int i = 0; i < count; ++i) {
           final String tserverName = tserversList.get(i).toString();
-          MasterClient.execute(ctx, new ClientExec<MasterClientService.Client>() {
+          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);


Mime
View raw message