}
for (HivePrincipal hivePrincipal : hivePrincipals) {
for (String roleName : roleNames) {
try {
IMetaStoreClient mClient = metastoreClientFactory.getHiveMetastoreClient();
mClient.revoke_role(roleName, hivePrincipal.getName(),
AuthorizationUtils.getThriftPrincipalType(hivePrincipal.getType()));
} catch (Exception e) {
String msg = "Error revoking roles for " + hivePrincipal.getName() + " to role "
+ roleName + ": " + e.getMessage();
throw new HiveAuthzPluginException(msg, e);