use of org.apache.hadoop.hive.metastore.api.GetPrincipalsInRoleRequest in project hive by apache.
the class SQLStdHiveAccessController method getHiveRoleGrants.
public static List<HiveRoleGrant> getHiveRoleGrants(IMetaStoreClient client, String roleName) throws Exception {
GetPrincipalsInRoleRequest request = new GetPrincipalsInRoleRequest(roleName);
GetPrincipalsInRoleResponse princGrantInfo = client.get_principals_in_role(request);
List<HiveRoleGrant> hiveRoleGrants = new ArrayList<HiveRoleGrant>();
for (RolePrincipalGrant thriftRoleGrant : princGrantInfo.getPrincipalGrants()) {
hiveRoleGrants.add(new HiveRoleGrant(thriftRoleGrant));
}
return hiveRoleGrants;
}
Aggregations