Examples of GetUserMappingsProtocol


Examples of org.apache.hadoop.tools.GetUserMappingsProtocol

    InetSocketAddress address = conf.getSocketAddr(
        JHAdminConfig.JHS_ADMIN_ADDRESS,
        JHAdminConfig.DEFAULT_JHS_ADMIN_ADDRESS,
        JHAdminConfig.DEFAULT_JHS_ADMIN_PORT);

    GetUserMappingsProtocol getUserMappingProtocol = HSProxies.createProxy(
        conf, address, GetUserMappingsProtocol.class,
        UserGroupInformation.getCurrentUser());
    for (String username : usernames) {
      StringBuilder sb = new StringBuilder();
      sb.append(username + " :");
      for (String group : getUserMappingProtocol.getGroupsForUser(username)) {
        sb.append(" ");
        sb.append(group);
      }
      System.out.println(sb);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.