Package org.apache.hadoop.test.system

Examples of org.apache.hadoop.test.system.ProxyUserDefinitions$GroupsAndHost


   * @return String - proxy users file.
   * @Exception - if no proxy users found in configuration.
   */
  public static String getProxyUsersFile(Configuration conf)
      throws Exception {
     ProxyUserDefinitions pud = getProxyUsersData(conf);
     String fileName = buildProxyUsersFile(pud.getProxyUsers());
     if (fileName == null) {
        LOG.error("Proxy users file not found.");
        throw new Exception("Proxy users file not found.");
     } else {
        return fileName;
View Full Code Here


  * @throws Exception
  */
public static List<String> listProxyUsers(Configuration conf,
     String loginUser) throws Exception {
   List<String> proxyUsers = new ArrayList<String>();
   ProxyUserDefinitions pud = getProxyUsersData(conf);
   Map<String, GroupsAndHost> usersData = pud.getProxyUsers();
   Collection users = usersData.keySet();
   Iterator<String> itr = users.iterator();
   while (itr.hasNext()) {
     String user = itr.next();
     if (!user.equals(loginUser)){ proxyUsers.add(user); };
View Full Code Here

    if (proxyUsersData.size() == 0) {
       LOG.error("No proxy users found in the configuration.");
       throw new Exception("No proxy users found in the configuration.");
    }

    ProxyUserDefinitions pud = new ProxyUserDefinitions() {
       public boolean writeToFile(URI filePath) throws IOException {
           throw new UnsupportedOperationException("No such methood exists.");
       };
    };

     for (String userName : proxyUsersData) {
        List<String> groups = Arrays.asList(conf.get("hadoop.proxyuser." +
            userName + ".groups").split("//,"));
        List<String> hosts = Arrays.asList(conf.get("hadoop.proxyuser." +
            userName + ".hosts").split("//,"));
        ProxyUserDefinitions.GroupsAndHost definitions =
            pud.new GroupsAndHost();
        definitions.setGroups(groups);
        definitions.setHosts(hosts);
        pud.addProxyUser(userName, definitions);
     }
     return pud;
  }
View Full Code Here

   * @return String - proxy users file.
   * @Exception - if no proxy users found in configuration.
   */
  public static String getProxyUsersFile(Configuration conf)
      throws Exception {
     ProxyUserDefinitions pud = getProxyUsersData(conf);
     String fileName = buildProxyUsersFile(pud.getProxyUsers());
     if (fileName == null) {
        LOG.error("Proxy users file not found.");
        throw new Exception("Proxy users file not found.");
     } else {
        return fileName;
View Full Code Here

  * @throws Exception
  */
public static List<String> listProxyUsers(Configuration conf,
     String loginUser) throws Exception {
   List<String> proxyUsers = new ArrayList<String>();
   ProxyUserDefinitions pud = getProxyUsersData(conf);
   Map<String, GroupsAndHost> usersData = pud.getProxyUsers();
   Collection users = usersData.keySet();
   Iterator<String> itr = users.iterator();
   while (itr.hasNext()) {
     String user = itr.next();
     if (!user.equals(loginUser)){ proxyUsers.add(user); };
View Full Code Here

    if (proxyUsersData.size() == 0) {
       LOG.error("No proxy users found in the configuration.");
       throw new Exception("No proxy users found in the configuration.");
    }

    ProxyUserDefinitions pud = new ProxyUserDefinitions() {
       public boolean writeToFile(URI filePath) throws IOException {
           throw new UnsupportedOperationException("No such methood exists.");
       };
    };

     for (String userName : proxyUsersData) {
        List<String> groups = Arrays.asList(conf.get("hadoop.proxyuser." +
            userName + ".groups").split("//,"));
        List<String> hosts = Arrays.asList(conf.get("hadoop.proxyuser." +
            userName + ".hosts").split("//,"));
        ProxyUserDefinitions.GroupsAndHost definitions =
            pud.new GroupsAndHost();
        definitions.setGroups(groups);
        definitions.setHosts(hosts);
        pud.addProxyUser(userName, definitions);
     }
     return pud;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.test.system.ProxyUserDefinitions$GroupsAndHost

Copyright © 2018 www.massapicom. 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.