hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r611765 - in /lucene/hadoop/branches/branch-0.15: CHANGES.txt src/java/org/apache/hadoop/mapred/TaskTracker.java
Date Mon, 14 Jan 2008 11:00:47 GMT
Author: ddas
Date: Mon Jan 14 03:00:44 2008
New Revision: 611765

URL: http://svn.apache.org/viewvc?rev=611765&view=rev
Log:
Merge -r 611759:611760 from trunk to 0.15 branch. Fixes HADOOP-2570.

Modified:
    lucene/hadoop/branches/branch-0.15/CHANGES.txt
    lucene/hadoop/branches/branch-0.15/src/java/org/apache/hadoop/mapred/TaskTracker.java

Modified: lucene/hadoop/branches/branch-0.15/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/branches/branch-0.15/CHANGES.txt?rev=611765&r1=611764&r2=611765&view=diff
==============================================================================
--- lucene/hadoop/branches/branch-0.15/CHANGES.txt (original)
+++ lucene/hadoop/branches/branch-0.15/CHANGES.txt Mon Jan 14 03:00:44 2008
@@ -9,6 +9,9 @@
 
     HADOOP-2540. fsck reports missing blocks incorrectly. (dhruba)
 
+    HADOOP-2570. "work" directory created unconditionally, and symlinks
+    created from the task cwds.
+
 Release 0.15.2 - 2008-01-02
 
   BUG FIXES

Modified: lucene/hadoop/branches/branch-0.15/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/branches/branch-0.15/src/java/org/apache/hadoop/mapred/TaskTracker.java?rev=611765&r1=611764&r2=611765&view=diff
==============================================================================
--- lucene/hadoop/branches/branch-0.15/src/java/org/apache/hadoop/mapred/TaskTracker.java
(original)
+++ lucene/hadoop/branches/branch-0.15/src/java/org/apache/hadoop/mapred/TaskTracker.java
Mon Jan 14 03:00:44 2008
@@ -609,6 +609,17 @@
         }
         fs.copyToLocalFile(new Path(jobFile), localJobFile);
         JobConf localJobConf = new JobConf(localJobFile);
+        
+        // create the 'work' directory
+        File workDir = new File(new File(localJobFile.toString()).getParent(),
+                                "work");
+        if (!workDir.mkdirs()) {
+          if (!workDir.isDirectory()) {
+            throw new IOException("Mkdirs failed to create " + workDir.toString());
+          }
+        }
+        
+        // unjar the job.jar files in workdir
         String jarFile = localJobConf.getJar();
         if (jarFile != null) {
           localJarFile = new Path(jobDir,"job.jar");
@@ -621,15 +632,6 @@
             out.close();
           }
 
-          // also unjar the job.jar files in workdir
-          File workDir = new File(
-                                  new File(localJobFile.toString()).getParent(),
-                                  "work");
-          if (!workDir.mkdirs()) {
-            if (!workDir.isDirectory()) {
-              throw new IOException("Mkdirs failed to create " + workDir.toString());
-            }
-          }
           RunJar.unJar(new File(localJarFile.toString()), workDir);
         }
         rjob.keepJobFiles = ((localJobConf.getKeepTaskFilesPattern() != null) ||
@@ -1280,6 +1282,20 @@
                     Path.SEPARATOR + task.getJobId() + Path.SEPARATOR +
                     task.getTaskId()), defaultJobConf );
       FileSystem localFs = FileSystem.getLocal(fConf);
+      
+      // create symlink for ../work if it already doesnt exist
+      String workDir = lDirAlloc.getLocalPathToRead(
+                         TaskTracker.getJobCacheSubdir() 
+                         + Path.SEPARATOR + task.getJobId() 
+                         + Path.SEPARATOR  
+                         + "work", defaultJobConf).toString();
+      String link = localTaskDir.getParent().toString() 
+                      + Path.SEPARATOR + "work";
+      File flink = new File(link);
+      if (!flink.exists())
+        FileUtil.symLink(workDir, link);
+      
+      // create the working-directory of the task 
       if (!localFs.mkdirs(localTaskDir)) {
         throw new IOException("Mkdirs failed to create " + localTaskDir.toString());
       }



Mime
View raw message