예제 #1
0
 private Set<String> loadRoles(String user) {
   try (HiveMetastoreClient client = clientProvider.createMetastoreClient()) {
     List<Role> roles = client.listRoles(user, USER);
     if (roles == null) {
       return ImmutableSet.of();
     }
     return ImmutableSet.copyOf(roles.stream().map(Role::getRoleName).collect(toSet()));
   } catch (TException e) {
     throw new PrestoException(HIVE_METASTORE_ERROR, e);
   }
 }