You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2013/12/05 00:58:21 UTC

[29/50] [abbrv] git commit: ACCUMULO-802 Fix exception handling in RPC call for config

ACCUMULO-802 Fix exception handling in RPC call for config


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: ab50556c6b8017df0e11d9dfd3592aab273dfbb1
Parents: 71bed4d
Author: Christopher Tubbs <ct...@apache.org>
Authored: Thu Nov 14 16:22:28 2013 -0500
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Wed Dec 4 18:46:11 2013 -0500

----------------------------------------------------------------------
 .../server/client/ClientServiceHandler.java     | 22 ++++++++++----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ab50556c/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java b/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
index 3148a3d..1deaa04 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
@@ -52,8 +52,8 @@ import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.Credentials;
 import org.apache.accumulo.core.security.SystemPermission;
-import org.apache.accumulo.core.security.TablePermission;
 import org.apache.accumulo.core.security.TableNamespacePermission;
+import org.apache.accumulo.core.security.TablePermission;
 import org.apache.accumulo.core.security.thrift.TCredentials;
 import org.apache.accumulo.server.conf.ServerConfiguration;
 import org.apache.accumulo.server.fs.VolumeManager;
@@ -186,12 +186,12 @@ public class ClientServiceHandler implements ClientService.Iface {
   }
 
   @Override
-  public void grantTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte permission) throws ThriftSecurityException,
-      ThriftTableOperationException {
+  public void grantTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte permission)
+      throws ThriftSecurityException, ThriftTableOperationException {
     String namespaceId = checkTableNamespaceId(tableNamespace, TableOperation.PERMISSION);
     security.grantTableNamespacePermission(credentials, user, namespaceId, TableNamespacePermission.getPermissionById(permission));
   }
-  
+
   @Override
   public void revokeSystemPermission(TInfo tinfo, TCredentials credentials, String user, byte permission) throws ThriftSecurityException {
     security.revokeSystemPermission(credentials, user, SystemPermission.getPermissionById(permission));
@@ -217,19 +217,19 @@ public class ClientServiceHandler implements ClientService.Iface {
   }
 
   @Override
-  public boolean hasTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte perm) throws ThriftSecurityException,
-      ThriftTableOperationException {
+  public boolean hasTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte perm)
+      throws ThriftSecurityException, ThriftTableOperationException {
     String namespaceId = checkTableNamespaceId(tableNamespace, TableOperation.PERMISSION);
     return security.hasTableNamespacePermission(credentials, user, namespaceId, TableNamespacePermission.getPermissionById(perm));
   }
-  
+
   @Override
-  public void revokeTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte permission) throws ThriftSecurityException,
-      ThriftTableOperationException {
+  public void revokeTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte permission)
+      throws ThriftSecurityException, ThriftTableOperationException {
     String namespaceId = checkTableNamespaceId(tableNamespace, TableOperation.PERMISSION);
     security.revokeTableNamespacePermission(credentials, user, namespaceId, TableNamespacePermission.getPermissionById(permission));
   }
-  
+
   @Override
   public Set<String> listLocalUsers(TInfo tinfo, TCredentials credentials) throws ThriftSecurityException {
     return security.listUsers(credentials);
@@ -428,7 +428,7 @@ public class ClientServiceHandler implements ClientService.Iface {
       namespaceId = TableNamespaces.getNamespaceId(instance, ns);
     } catch (TableNamespaceNotFoundException e) {
       String why = "Could not find table namespace while getting configuration.";
-      throw new ThriftTableOperationException(null, ns, null, null, why);
+      throw new ThriftTableOperationException(null, ns, null, TableOperationExceptionType.NOTFOUND, why);
     }
     AccumuloConfiguration config = ServerConfiguration.getTableNamespaceConfiguration(instance, namespaceId);
     return conf(credentials, config);