hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject svn commit: r642477 - in /hadoop/core/branches/branch-0.16: ./ src/java/org/apache/hadoop/dfs/ src/java/org/apache/hadoop/mapred/ src/java/org/apache/hadoop/security/ src/test/org/apache/hadoop/mapred/
Date Sat, 29 Mar 2008 01:42:47 GMT
Author: nigel
Date: Fri Mar 28 18:42:45 2008
New Revision: 642477

URL: http://svn.apache.org/viewvc?rev=642477&view=rev
Log:
HADOOP-2833. Revert bad commit.

Removed:
    hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/mapred/TestSubmitJob.java
Modified:
    hadoop/core/branches/branch-0.16/CHANGES.txt
    hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/DFSClient.java
    hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/DistributedFileSystem.java
    hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/mapred/JobClient.java
    hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/security/UnixUserGroupInformation.java

Modified: hadoop/core/branches/branch-0.16/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/CHANGES.txt?rev=642477&r1=642476&r2=642477&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.16/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.16/CHANGES.txt Fri Mar 28 18:42:45 2008
@@ -64,9 +64,6 @@
     between the RecordReader and the map threads. (Alejandro Abdelnur via
     omalley)
 
-    HADOOP-2833. Do not use "Dr. Who" as the default user in JobClient.
-    A valid user name is required. (Tsz Wo (Nicholas), SZE via rangadi)
-
 Release 0.16.1 - 2008-03-13
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/DFSClient.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/DFSClient.java?rev=642477&r1=642476&r2=642477&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/DFSClient.java (original)
+++ hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/DFSClient.java Fri Mar
28 18:42:45 2008
@@ -56,11 +56,10 @@
  *
  ********************************************************/
 class DFSClient implements FSConstants {
-  public static final Log LOG = LogFactory.getLog(DFSClient.class);
+  public static final Log LOG = LogFactory.getLog("org.apache.hadoop.fs.DFSClient");
   static final int MAX_BLOCK_ACQUIRE_FAILURES = 3;
   private static final int TCP_WINDOW_SIZE = 128 * 1024; // 128 KB
   ClientProtocol namenode;
-  final UnixUserGroupInformation ugi;
   volatile boolean clientRunning = true;
   Random r = new Random();
   String clientName;
@@ -141,13 +140,6 @@
     this.socketTimeout = conf.getInt("dfs.socket.timeout", 
                                      FSConstants.READ_TIMEOUT);
     this.socketFactory = NetUtils.getSocketFactory(conf, ClientProtocol.class);
-
-    try {
-      this.ugi = UnixUserGroupInformation.login(conf, true);
-    } catch (LoginException e) {
-      throw (IOException)(new IOException().initCause(e));
-    }
-
     this.namenode = createNamenode(nameNodeAddr, conf);
     String taskId = conf.get("mapred.task.id");
     if (taskId != null) {

Modified: hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/DistributedFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/DistributedFileSystem.java?rev=642477&r1=642476&r2=642477&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/DistributedFileSystem.java
(original)
+++ hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/DistributedFileSystem.java
Fri Mar 28 18:42:45 2008
@@ -96,11 +96,6 @@
     workingDir = makeAbsolute(dir);
   }
 
-  /** {@inheritDoc} */
-  public Path getHomeDirectory() {
-    return new Path("/user/" + dfs.ugi.getUserName()).makeQualified(this);
-  }
-
   private String getPathName(Path file) {
     checkPath(file);
     String result = makeAbsolute(file).toUri().getPath();
@@ -363,7 +358,6 @@
       if(FileNotFoundException.class.getName().equals(re.getClassName())) {
         throw new FileNotFoundException("File does not exist: " + p);
       }
-      throw re;
     }
   }
 
@@ -379,7 +373,6 @@
       if(FileNotFoundException.class.getName().equals(re.getClassName())) {
         throw new FileNotFoundException("File does not exist: " + p);
       }
-      throw re;
     }
   }
 }

Modified: hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/mapred/JobClient.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/mapred/JobClient.java?rev=642477&r1=642476&r2=642477&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/mapred/JobClient.java (original)
+++ hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/mapred/JobClient.java Fri
Mar 28 18:42:45 2008
@@ -458,12 +458,13 @@
      * set this user's id in job configuration, so later job files can be
      * accessed using this user's id
      */
-    UnixUserGroupInformation ugi = null;
     try {
-      ugi = UnixUserGroupInformation.login(job, true);
+      UnixUserGroupInformation.saveToConf(job,
+          UnixUserGroupInformation.UGI_PROPERTY_NAME, UnixUserGroupInformation
+          .login(job));
     } catch (LoginException e) {
-      throw (IOException)(new IOException(
-          "Failed to get the current user's information.").initCause(e));
+      throw new IOException("Failed to get the current user's information: "
+          + e.getMessage());
     }
       
     //
@@ -526,7 +527,8 @@
     }
 
     // Set the user's name and working directory
-    job.setUser(ugi.getUserName());
+    String user = System.getProperty("user.name");
+    job.setUser(user != null ? user : "Dr Who");
     if (job.getWorkingDirectory() == null) {
       job.setWorkingDirectory(fs.getWorkingDirectory());          
     }

Modified: hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/security/UnixUserGroupInformation.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/security/UnixUserGroupInformation.java?rev=642477&r1=642476&r2=642477&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/security/UnixUserGroupInformation.java
(original)
+++ hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/security/UnixUserGroupInformation.java
Fri Mar 28 18:42:45 2008
@@ -251,12 +251,6 @@
     }
   }
 
-  /** Equivalent to login(conf, false). */
-  public static UnixUserGroupInformation login(Configuration conf)
-    throws LoginException {
-    return login(conf, false);
-  }
-  
   /** Get a user's name & its group names from the given configuration; 
    * If it is not defined in the configuration, get the current user's
    * information from Unix.
@@ -264,20 +258,16 @@
    * the UGI map.
    * 
    *  @param conf either a job configuration or client's configuration
-   *  @param save saving it to conf?
    *  @return UnixUserGroupInformation a user/group information
    *  @exception LoginException if not able to get the user/group information
    */
-  public static UnixUserGroupInformation login(Configuration conf, boolean save
-      ) throws LoginException {
+  public static UnixUserGroupInformation login(Configuration conf) 
+   throws LoginException {
     UnixUserGroupInformation ugi = readFromConf(conf, UGI_PROPERTY_NAME);
     if (ugi == null) {
       ugi = login();
       LOG.debug("Unix Login: " + ugi);
-      if (save) {
-        saveToConf(conf, UGI_PROPERTY_NAME, ugi);
-      }
-    }
+    } 
     return ugi;
   }
   



Mime
View raw message