hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r1006357 - in /hadoop/common/branches/branch-0.21: ./ src/contrib/ec2/ src/docs/ src/java/ src/test/core/ src/test/system/java/org/apache/hadoop/test/system/
Date Sun, 10 Oct 2010 21:53:01 GMT
Author: cos
Date: Sun Oct 10 21:53:00 2010
New Revision: 1006357

URL: http://svn.apache.org/viewvc?rev=1006357&view=rev
Log:
HADOOP-6944. svn merge -c 1006356

Added:
    hadoop/common/branches/branch-0.21/src/test/system/java/org/apache/hadoop/test/system/ProxyUserDefinitions.java
      - copied unchanged from r1006356, hadoop/common/trunk/src/test/system/java/org/apache/hadoop/test/system/ProxyUserDefinitions.java
Modified:
    hadoop/common/branches/branch-0.21/   (props changed)
    hadoop/common/branches/branch-0.21/CHANGES.txt   (contents, props changed)
    hadoop/common/branches/branch-0.21/src/contrib/ec2/   (props changed)
    hadoop/common/branches/branch-0.21/src/docs/   (props changed)
    hadoop/common/branches/branch-0.21/src/java/   (props changed)
    hadoop/common/branches/branch-0.21/src/test/core/   (props changed)
    hadoop/common/branches/branch-0.21/src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java

Propchange: hadoop/common/branches/branch-0.21/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct 10 21:53:00 2010
@@ -1,2 +1,2 @@
-/hadoop/common/trunk:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,955438,961559,962914,964130,964134,964939,966508,966919,967220,979485,979942,990681,1004107
+/hadoop/common/trunk:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,955438,961559,962914,964130,964134,964939,966508,966919,967220,979485,979942,990681,1004107,1006356
 /hadoop/core/branches/branch-0.19/core:713112

Modified: hadoop/common/branches/branch-0.21/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.21/CHANGES.txt?rev=1006357&r1=1006356&r2=1006357&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.21/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.21/CHANGES.txt Sun Oct 10 21:53:00 2010
@@ -21,6 +21,9 @@ Release 0.21.1 - Unreleased
 
     HADOOP-6993. Broken link on cluster setup page of docs. (eli)    
 
+    HADOOP-6944. [Herriot] Implement a functionality for getting proxy users
+    definitions like groups and hosts. (Vinay Thota via cos)
+
 Release 0.21.0 - 2010-08-13
 
   INCOMPATIBLE CHANGES

Propchange: hadoop/common/branches/branch-0.21/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct 10 21:53:00 2010
@@ -1,4 +1,4 @@
-/hadoop/common/trunk/CHANGES.txt:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,951614,953504,955438,961559,962914,964130,964134,964939,966508,966919,967220,979942,990681,1004107
+/hadoop/common/trunk/CHANGES.txt:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,951614,953504,955438,961559,962914,964130,964134,964939,966508,966919,967220,979942,990681,1004107,1006356
 /hadoop/core/branches/branch-0.18/CHANGES.txt:727226
 /hadoop/core/branches/branch-0.19/CHANGES.txt:713112
 /hadoop/core/trunk/CHANGES.txt:776175-785643,785929-786278

Propchange: hadoop/common/branches/branch-0.21/src/contrib/ec2/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct 10 21:53:00 2010
@@ -1,3 +1,3 @@
-/hadoop/common/trunk/src/contrib/ec2:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,955438,961559,962914,964130,964134,964939,966508,966919,967220,979485,979942,990681,1004107
+/hadoop/common/trunk/src/contrib/ec2:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,955438,961559,962914,964130,964134,964939,966508,966919,967220,979485,979942,990681,1004107,1006356
 /hadoop/core/branches/branch-0.19/core/src/contrib/ec2:713112
 /hadoop/core/trunk/src/contrib/ec2:776175-784663

Propchange: hadoop/common/branches/branch-0.21/src/docs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct 10 21:53:00 2010
@@ -1,2 +1,2 @@
-/hadoop/common/trunk/src/docs:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,955438,961559,962914,964130,964134,964939,966508,966919,967220,979485,979942,990681,1004107
+/hadoop/common/trunk/src/docs:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,955438,961559,962914,964130,964134,964939,966508,966919,967220,979485,979942,990681,1004107,1006356
 /hadoop/core/branches/branch-0.19/src/docs:713112

Propchange: hadoop/common/branches/branch-0.21/src/java/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct 10 21:53:00 2010
@@ -1,3 +1,3 @@
-/hadoop/common/trunk/src/java:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,955438,961559,962914,964130,964134,964939,966508,966919,967220,979485,979942,990681,1004107
+/hadoop/common/trunk/src/java:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,955438,961559,962914,964130,964134,964939,966508,966919,967220,979485,979942,990681,1004107,1006356
 /hadoop/core/branches/branch-0.19/core/src/java:713112
 /hadoop/core/trunk/src/core:776175-785643,785929-786278

Propchange: hadoop/common/branches/branch-0.21/src/test/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct 10 21:53:00 2010
@@ -1,3 +1,3 @@
-/hadoop/common/trunk/src/test/core:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,955438,961559,962914,964130,964134,964939,966508,966919,967220,979485,979942,990681,1004107
+/hadoop/common/trunk/src/test/core:944521,945941-945953,947218,947222,947882,948174,948237,948242,950309,951259,955438,961559,962914,964130,964134,964939,966508,966919,967220,979485,979942,990681,1004107,1006356
 /hadoop/core/branches/branch-0.19/core/src/test/core:713112
 /hadoop/core/trunk/src/test/core:776175-785643,785929-786278

Modified: hadoop/common/branches/branch-0.21/src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.21/src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java?rev=1006357&r1=1006356&r2=1006357&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.21/src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java
(original)
+++ hadoop/common/branches/branch-0.21/src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java
Sun Oct 10 21:53:00 2010
@@ -27,8 +27,11 @@ import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Iterator;
 import java.util.Enumeration;
+import java.util.Arrays;
 import java.util.Hashtable;
+import java.net.URI;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -50,8 +53,6 @@ public abstract class AbstractDaemonClus
   private String newConfDir = null;  
   private static final  String CONF_HADOOP_LOCAL_DIR =
       "test.system.hdrc.hadoop.local.confdir"; 
-  private static final  String CONF_HADOOP_MULTI_USER_LIST =
-      "test.system.hdrc.multi-user.list.path";
   private final static Object waitLock = new Object();
   
   /**
@@ -302,27 +303,44 @@ public abstract class AbstractDaemonClus
   }
 
   /**
-   * Get the multi users list.
-   * @return ArrayList - users list as a array list.
-   * @throws IOException - if an I/O error occurs.
-   */
-  public ArrayList<String> getHadoopMultiUsersList() throws
-     IOException {
-    String hadoopUserListPath = conf.get(CONF_HADOOP_MULTI_USER_LIST);
-    if (hadoopUserListPath == null || hadoopUserListPath.isEmpty()) {
-      LOG.error("Proxy user list path has not been passed for "
-          + CONF_HADOOP_MULTI_USER_LIST);
-      throw new IllegalArgumentException(
-          "Proxy user list hasn't been provided.");
-    }
-    File fileObj = new File(hadoopUserListPath);
-    DataInputStream disObj = new DataInputStream(new FileInputStream(fileObj));
-    ArrayList<String> usersList = new ArrayList<String>();
-    String strLine = null;
-    while((strLine = disObj.readLine()) != null){
-      usersList.add(strLine.substring(0,strLine.indexOf(',')));
+   * Get the proxy user definitions from cluster from configuration.
+   * @return ProxyUserDefinitions - proxy users data like groups and hosts.
+   * @throws Exception - if no proxy users found in config.
+   */
+  public ProxyUserDefinitions getHadoopProxyUsers() throws
+     Exception {
+    Iterator itr = conf.iterator();
+    ArrayList<String> proxyUsers = new ArrayList<String>();
+    while (itr.hasNext()) {
+      if (itr.next().toString().indexOf("hadoop.proxyuser") >= 0 &&
+          itr.next().toString().indexOf("groups=") >= 0) {
+         proxyUsers.add(itr.next().toString().split("\\.")[2]);
+      }
+    }
+    if (proxyUsers.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() {
+      @Override
+      public boolean writeToFile(URI filePath) throws IOException {
+        throw new UnsupportedOperationException("No such method exists.");
+      };
+    };
+
+    for (String userName : proxyUsers) {
+       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 usersList;
+    return pud;
   }
   
   /**



Mime
View raw message