hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r747290 - in /hadoop/core/trunk: CHANGES.txt src/mapred/org/apache/hadoop/mapred/JobHistory.java src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
Date Tue, 24 Feb 2009 06:55:30 GMT
Author: ddas
Date: Tue Feb 24 06:55:29 2009
New Revision: 747290

URL: http://svn.apache.org/viewvc?rev=747290&view=rev
Log:
HADOOP-5278. Fixes a problem to do with logging the finish time of a task during recovery
 (after a JobTracker restart). Contributed by Amar Kamat.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java
    hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=747290&r1=747289&r2=747290&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue Feb 24 06:55:29 2009
@@ -224,6 +224,9 @@
     HADOOP-5276. Fixes a problem to do with updating the start time of a task when
     the tracker that ran the task is lost. (Amar Kamat via ddas)
 
+    HADOOP-5278. Fixes a problem to do with logging the finish time of a task during
+    recovery (after a JobTracker restart). (Amar Kamat via ddas)
+
 Release 0.20.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java?rev=747290&r1=747289&r2=747290&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java Tue Feb 24 06:55:29
2009
@@ -1178,6 +1178,26 @@
         }
       }
     }
+
+    /**
+     * Update the finish time of task. 
+     * @param taskId task id
+     * @param finishTime finish time of task in ms
+     */
+    public static void logUpdates(TaskID taskId, long finishTime){
+      if (!disableHistory){
+        ArrayList<PrintWriter> writer = openJobs.get(JOBTRACKER_UNIQUE_STRING 
+                                                     + taskId.getJobID()); 
+
+        if (null != writer){
+          JobHistory.log(writer, RecordTypes.Task, 
+                         new Keys[]{Keys.TASKID, Keys.FINISH_TIME}, 
+                         new String[]{ taskId.toString(), 
+                                       String.valueOf(finishTime)});
+        }
+      }
+    }
+
     /**
      * Log job failed event.
      * @param taskId task id

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java?rev=747290&r1=747289&r2=747290&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java Tue Feb 24 06:55:29
2009
@@ -260,6 +260,7 @@
    */
   public void setExecFinishTime(long finishTime) {
     execFinishTime = finishTime;
+    JobHistory.Task.logUpdates(id, execFinishTime); // log the update
   }
   
   /**



Mime
View raw message