use of org.apache.hadoop.hive.metastore.api.RolePrincipalGrant in project hive by apache.
the class DDLTask method writeRoleGrantsInfo.
static String writeRoleGrantsInfo(List<RolePrincipalGrant> roleGrants, boolean testMode) {
if (roleGrants == null || roleGrants.isEmpty()) {
return "";
}
StringBuilder builder = new StringBuilder();
// sort the list to get sorted (deterministic) output (for ease of testing)
Collections.sort(roleGrants);
for (RolePrincipalGrant roleGrant : roleGrants) {
appendNonNull(builder, roleGrant.getRoleName(), true);
appendNonNull(builder, roleGrant.isGrantOption());
appendNonNull(builder, testMode ? -1 : roleGrant.getGrantTime() * 1000L);
appendNonNull(builder, roleGrant.getGrantorName());
}
return builder.toString();
}
Aggregations