Search in sources :

Example 1 with GetRoleGrantsForPrincipalRequest

use of org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalRequest in project presto by prestodb.

the class ThriftHiveMetastoreClient method listRoleGrants.

@Override
public List<RolePrincipalGrant> listRoleGrants(String principalName, PrincipalType principalType) throws TException {
    GetRoleGrantsForPrincipalRequest request = new GetRoleGrantsForPrincipalRequest(principalName, principalType);
    GetRoleGrantsForPrincipalResponse resp = client.get_role_grants_for_principal(request);
    return ImmutableList.copyOf(resp.getPrincipalGrants());
}
Also used : GetRoleGrantsForPrincipalResponse(org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalResponse) GetRoleGrantsForPrincipalRequest(org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalRequest)

Example 2 with GetRoleGrantsForPrincipalRequest

use of org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalRequest in project hive by apache.

the class SQLStdHiveAccessController method getRoleGrants.

private List<RolePrincipalGrant> getRoleGrants(String principalName, PrincipalType principalType) throws MetaException, TException, HiveAuthzPluginException {
    GetRoleGrantsForPrincipalRequest req = new GetRoleGrantsForPrincipalRequest(principalName, principalType);
    IMetaStoreClient metastoreClient = metastoreClientFactory.getHiveMetastoreClient();
    GetRoleGrantsForPrincipalResponse resp = metastoreClient.get_role_grants_for_principal(req);
    return resp.getPrincipalGrants();
}
Also used : GetRoleGrantsForPrincipalResponse(org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalResponse) GetRoleGrantsForPrincipalRequest(org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalRequest) IMetaStoreClient(org.apache.hadoop.hive.metastore.IMetaStoreClient)

Example 3 with GetRoleGrantsForPrincipalRequest

use of org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalRequest in project hive by apache.

the class Hive method getRoleGrantInfoForPrincipal.

public List<RolePrincipalGrant> getRoleGrantInfoForPrincipal(String principalName, PrincipalType principalType) throws HiveException {
    try {
        GetRoleGrantsForPrincipalRequest req = new GetRoleGrantsForPrincipalRequest(principalName, principalType);
        GetRoleGrantsForPrincipalResponse resp = getMSC().get_role_grants_for_principal(req);
        return resp.getPrincipalGrants();
    } catch (Exception e) {
        throw new HiveException(e);
    }
}
Also used : GetRoleGrantsForPrincipalResponse(org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalResponse) GetRoleGrantsForPrincipalRequest(org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalRequest) AlreadyExistsException(org.apache.hadoop.hive.metastore.api.AlreadyExistsException) LockException(org.apache.hadoop.hive.ql.lockmgr.LockException) InvalidOperationException(org.apache.hadoop.hive.metastore.api.InvalidOperationException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) ExecutionException(java.util.concurrent.ExecutionException) NoSuchObjectException(org.apache.hadoop.hive.metastore.api.NoSuchObjectException) MetaException(org.apache.hadoop.hive.metastore.api.MetaException) HiveMetaException(org.apache.hadoop.hive.metastore.HiveMetaException) SemanticException(org.apache.hadoop.hive.ql.parse.SemanticException) TApplicationException(org.apache.thrift.TApplicationException) TException(org.apache.thrift.TException) SerDeException(org.apache.hadoop.hive.serde2.SerDeException) FileNotFoundException(java.io.FileNotFoundException) JDODataStoreException(javax.jdo.JDODataStoreException)

Aggregations

GetRoleGrantsForPrincipalRequest (org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalRequest)3 GetRoleGrantsForPrincipalResponse (org.apache.hadoop.hive.metastore.api.GetRoleGrantsForPrincipalResponse)3 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 UnknownHostException (java.net.UnknownHostException)1 ExecutionException (java.util.concurrent.ExecutionException)1 JDODataStoreException (javax.jdo.JDODataStoreException)1 HiveMetaException (org.apache.hadoop.hive.metastore.HiveMetaException)1 IMetaStoreClient (org.apache.hadoop.hive.metastore.IMetaStoreClient)1 AlreadyExistsException (org.apache.hadoop.hive.metastore.api.AlreadyExistsException)1 InvalidOperationException (org.apache.hadoop.hive.metastore.api.InvalidOperationException)1 MetaException (org.apache.hadoop.hive.metastore.api.MetaException)1 NoSuchObjectException (org.apache.hadoop.hive.metastore.api.NoSuchObjectException)1 LockException (org.apache.hadoop.hive.ql.lockmgr.LockException)1 SemanticException (org.apache.hadoop.hive.ql.parse.SemanticException)1 SerDeException (org.apache.hadoop.hive.serde2.SerDeException)1 TApplicationException (org.apache.thrift.TApplicationException)1 TException (org.apache.thrift.TException)1