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());
}
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();
}
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);
}
}
Aggregations