hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r907116 - in /hadoop/mapreduce/trunk: ./ src/java/org/apache/hadoop/mapred/ src/java/org/apache/hadoop/mapreduce/ src/java/org/apache/hadoop/mapreduce/jobhistory/
Date Fri, 05 Feb 2010 22:30:32 GMT
Author: omalley
Date: Fri Feb  5 22:30:31 2010
New Revision: 907116

URL: http://svn.apache.org/viewvc?rev=907116&view=rev
Log:
MAPREDUCE-1440. Replace the long user name in MapReduce with the local
name. (omalley)

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/IsolationRunner.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobQueueClient.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/LinuxTaskController.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/LocalJobRunner.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/QueueManager.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Cluster.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/JobSubmissionFiles.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/jobhistory/JobHistory.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=907116&r1=907115&r2=907116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Fri Feb  5 22:30:31 2010
@@ -155,6 +155,9 @@
     MAPREDUCE-64. Eliminate io.sort.record.percent from MapTask configuration.
     (cdouglas)
 
+    MAPREDUCE-1440. Replace the long user name in MapReduce with the local
+    name. (omalley)
+
   OPTIMIZATIONS
 
     MAPREDUCE-270. Fix the tasktracker to optionally send an out-of-band

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/IsolationRunner.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/IsolationRunner.java?rev=907116&r1=907115&r2=907116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/IsolationRunner.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/IsolationRunner.java Fri Feb
 5 22:30:31 2010
@@ -158,7 +158,7 @@
     if (args.length > 1) {
       user = args[1];
     } else {
-      user = UserGroupInformation.getCurrentUser().getUserName();
+      user = UserGroupInformation.getCurrentUser().getShortUserName();
     }
     JobConf conf = new JobConf(new Path(jobFilename.toString()));
     conf.setUser(user);

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobQueueClient.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobQueueClient.java?rev=907116&r1=907115&r2=907116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobQueueClient.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobQueueClient.java Fri Feb 
5 22:30:31 2010
@@ -194,7 +194,7 @@
     QueueAclsInfo[] queueAclsInfoList = jc.getQueueAclsForCurrentUser();
     UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
     if (queueAclsInfoList.length > 0) {
-      System.out.println("Queue acls for user :  " + ugi.getUserName());
+      System.out.println("Queue acls for user :  " + ugi.getShortUserName());
       System.out.println("\nQueue  Operations");
       System.out.println("=====================");
       for (QueueAclsInfo queueInfo : queueAclsInfoList) {
@@ -210,7 +210,7 @@
         System.out.println();
       }
     } else {
-      System.out.println("User " + ugi.getUserName()
+      System.out.println("User " + ugi.getShortUserName()
           + " does not have access to any queue. \n");
     }
   }

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java?rev=907116&r1=907115&r2=907116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java Fri Feb  5 22:30:31
2010
@@ -1343,7 +1343,7 @@
     }
     
     supergroup = conf.get(JT_SUPERGROUP, "supergroup");
-    LOG.info("Starting jobtracker with owner as " + mrOwner.getUserName() 
+    LOG.info("Starting jobtracker with owner as " + mrOwner.getShortUserName() 
              + " and supergroup as " + supergroup);
     clock = newClock;
 
@@ -1478,9 +1478,9 @@
         }
         try {
           FileStatus systemDirStatus = fs.getFileStatus(systemDir);
-          if (!systemDirStatus.getOwner().equals(mrOwner.getUserName())) {
+          if (!systemDirStatus.getOwner().equals(mrOwner.getShortUserName())) {
             throw new AccessControlException("The systemdir " + systemDir + 
-                " is not owned by " + mrOwner.getUserName());
+                " is not owned by " + mrOwner.getShortUserName());
           }
           if (!systemDirStatus.getPermission().equals(SYSTEM_DIR_PERMISSION)) {
             LOG.warn("Incorrect permissions on " + systemDir + 
@@ -2949,7 +2949,7 @@
     //the conversion from String to Text for the UGI's username will
     //not be required when we have the UGI to return us the username as
     //Text.
-    JobInfo jobInfo = new JobInfo(jobId, new Text(ugi.getUserName()), 
+    JobInfo jobInfo = new JobInfo(jobId, new Text(ugi.getShortUserName()), 
         new Path(jobSubmitDir));
     JobInProgress job = 
       new JobInProgress(this, this.conf, restartCount, jobInfo, ts);
@@ -3036,7 +3036,7 @@
     String queue = job.getProfile().getQueueName();
     if (!queueManager.hasAccess(queue, job, oper, ugi)) {
       throw new AccessControlException("User " 
-                            + ugi.getUserName() 
+                            + ugi.getShortUserName() 
                             + " cannot perform "
                             + "operation " + oper + " on queue " + queue +
                             ".\n Please run \"hadoop queue -showacls\" " +
@@ -3665,7 +3665,7 @@
     Path stagingRootDir = new Path(conf.get(JTConfig.JT_STAGING_AREA_ROOT, 
         "/tmp/hadoop/mapred/staging"));
     FileSystem fs = stagingRootDir.getFileSystem(conf);
-    String user = UserGroupInformation.getCurrentUser().getUserName();
+    String user = UserGroupInformation.getCurrentUser().getShortUserName();
     return fs.makeQualified(new Path(stagingRootDir, 
                                 user+"/.staging")).toString();
   }
@@ -3890,7 +3890,7 @@
    */
   private synchronized boolean isSuperUser() throws IOException {
     UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
-    if (mrOwner.getUserName().equals(ugi.getUserName()) ) {
+    if (mrOwner.getShortUserName().equals(ugi.getShortUserName()) ) {
       return true;
     }
     String[] groups = ugi.getGroupNames();
@@ -3909,7 +3909,7 @@
   public synchronized void refreshNodes() throws IOException {
     // check access
     if (!isSuperUser()) {
-      String user = UserGroupInformation.getCurrentUser().getUserName();
+      String user = UserGroupInformation.getCurrentUser().getShortUserName();
       throw new AccessControlException(user + 
                                        " is not authorized to refresh nodes.");
     }
@@ -4141,7 +4141,7 @@
   @Override
   public void refreshQueues() throws IOException{
     LOG.info("Refreshing queue information. requested by : " + 
-             UserGroupInformation.getCurrentUser().getUserName());
+             UserGroupInformation.getCurrentUser().getShortUserName());
     this.queueManager.refreshQueues(new Configuration(this.conf),
         taskScheduler.getQueueRefresher());
   }
@@ -4200,7 +4200,7 @@
   @Override
   public void refreshUserToGroupsMappings(Configuration conf) throws IOException {
     LOG.info("Refreshing all user-to-groups mappings. Requested by user: " + 
-             UserGroupInformation.getCurrentUser().getUserName());
+             UserGroupInformation.getCurrentUser().getShortUserName());
     
     Groups.getUserToGroupsMappingService(conf).refresh();
   }

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/LinuxTaskController.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/LinuxTaskController.java?rev=907116&r1=907115&r2=907116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/LinuxTaskController.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/LinuxTaskController.java Fri
Feb  5 22:30:31 2010
@@ -411,7 +411,7 @@
       throws IOException {
     String[] taskControllerCmd = new String[3 + cmdArgs.size()];
     taskControllerCmd[0] = getTaskControllerExecutablePath();
-    taskControllerCmd[1] = TaskTracker.getShortUserName(userName);
+    taskControllerCmd[1] = userName;
     taskControllerCmd[2] = String.valueOf(command.ordinal());
     int i = 3;
     for (String cmdArg : cmdArgs) {

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/LocalJobRunner.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/LocalJobRunner.java?rev=907116&r1=907115&r2=907116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/LocalJobRunner.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/LocalJobRunner.java Fri Feb 
5 22:30:31 2010
@@ -697,7 +697,7 @@
     UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
     String user;
     if (ugi != null) {
-      user = ugi.getUserName() + rand.nextInt();
+      user = ugi.getShortUserName() + rand.nextInt();
     } else {
       user = "dummy" + rand.nextInt();
     }

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/QueueManager.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/QueueManager.java?rev=907116&r1=907115&r2=907116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/QueueManager.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/QueueManager.java Fri Feb  5
22:30:31 2010
@@ -281,7 +281,7 @@
 
     if (oper.isJobOwnerAllowed()) {
       if (job != null
-        && job.getJobConf().getUser().equals(ugi.getUserName())) {
+        && job.getJobConf().getUser().equals(ugi.getShortUserName())) {
         return true;
       }
     }

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java?rev=907116&r1=907115&r2=907116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java Fri Feb  5 22:30:31
2010
@@ -454,19 +454,8 @@
     localizer = l;
   }
 
-  /**
-   * This method must be called in all places where the short user name is
-   * desired (e.g. TaskTracker.getUserDir and in the LinuxTaskController).
-   * The short name is required in the path creation 
-   * (like TaskTracker.getUserDir) and while launching task processes as the
-   * user.
-   */
-  static String getShortUserName(String name) {
-    return UserGroupInformation.createRemoteUser(name).getShortUserName();
-  }
-  
   public static String getUserDir(String user) {
-    return TaskTracker.SUBDIR + Path.SEPARATOR + getShortUserName(user);
+    return TaskTracker.SUBDIR + Path.SEPARATOR + user;
   }
 
   public static String getPrivateDistributedCacheDir(String user) {

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Cluster.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Cluster.java?rev=907116&r1=907115&r2=907116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Cluster.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Cluster.java Fri Feb  5 22:30:31
2010
@@ -254,7 +254,7 @@
       jobHistoryDir = new Path(client.getJobHistoryDir());
     }
     return JobHistory.getJobHistoryFile(jobHistoryDir, jobId, 
-        ugi.getUserName()).toString();
+        ugi.getShortUserName()).toString();
   }
 
   /**

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/JobSubmissionFiles.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/JobSubmissionFiles.java?rev=907116&r1=907115&r2=907116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/JobSubmissionFiles.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/JobSubmissionFiles.java Fri
Feb  5 22:30:31 2010
@@ -97,8 +97,8 @@
     String realUser;
     String currentUser;
     UserGroupInformation ugi = UserGroupInformation.getLoginUser();
-    realUser = ugi.getUserName();
-    currentUser = UserGroupInformation.getCurrentUser().getUserName();
+    realUser = ugi.getShortUserName();
+    currentUser = UserGroupInformation.getCurrentUser().getShortUserName();
     if (fs.exists(stagingArea)) {
       FileStatus fsStatus = fs.getFileStatus(stagingArea);
       String owner = fsStatus.getOwner();

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/jobhistory/JobHistory.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/jobhistory/JobHistory.java?rev=907116&r1=907115&r2=907116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/jobhistory/JobHistory.java
(original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/jobhistory/JobHistory.java
Fri Feb  5 22:30:31 2010
@@ -230,8 +230,7 @@
    */
   public void setupEventWriter(JobID jobId, JobConf jobConf)
   throws IOException {
-    Path logFile = getJobHistoryFile(logDir, jobId, 
-        UserGroupInformation.createRemoteUser(getUserName(jobConf)).getShortUserName());
+    Path logFile = getJobHistoryFile(logDir, jobId, getUserName(jobConf));
   
     if (logDir == null) {
       LOG.info("Log Directory is null, returning");



Mime
View raw message