hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r752924 - in /hadoop/core/branches/branch-0.20: CHANGES.txt src/mapred/org/apache/hadoop/mapred/JobInProgress.java src/test/org/apache/hadoop/mapred/TestLostTracker.java
Date Thu, 12 Mar 2009 16:37:39 GMT
Author: ddas
Date: Thu Mar 12 16:37:39 2009
New Revision: 752924

URL: http://svn.apache.org/viewvc?rev=752924&view=rev
Log:
HADOOP-5276. Applied the patch on the 0.20 branch as well.

Modified:
    hadoop/core/branches/branch-0.20/CHANGES.txt
    hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
    hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/mapred/TestLostTracker.java

Modified: hadoop/core/branches/branch-0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/CHANGES.txt?rev=752924&r1=752923&r2=752924&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.20/CHANGES.txt Thu Mar 12 16:37:39 2009
@@ -700,6 +700,9 @@
     HADOOP-5395. Change the exception message when a job is submitted to an
     invalid queue. (Rahul Kumar Singh via yhemanth)
 
+    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)
+
 Release 0.19.2 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java?rev=752924&r1=752923&r2=752924&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
(original)
+++ hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
Thu Mar 12 16:37:39 2009
@@ -2426,6 +2426,12 @@
                                                     reason,
                                                     trackerName, phase,
                                                     new Counters());
+    // update the actual start-time of the attempt
+    TaskStatus oldStatus = tip.getTaskStatus(taskid); 
+    long startTime = oldStatus == null
+                     ? System.currentTimeMillis()
+                     : oldStatus.getStartTime();
+    status.setStartTime(startTime);
     status.setFinishTime(System.currentTimeMillis());
     boolean wasComplete = tip.isComplete();
     updateTaskStatus(tip, status, metrics);

Modified: hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/mapred/TestLostTracker.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/mapred/TestLostTracker.java?rev=752924&r1=752923&r2=752924&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/mapred/TestLostTracker.java
(original)
+++ hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/mapred/TestLostTracker.java
Thu Mar 12 16:37:39 2009
@@ -94,8 +94,29 @@
     assertTrue(tip.isComplete());
     assertEquals(tip.numKilledTasks(), 1);
     
+    // check if the task statuses for the tasks are sane
+    JobTracker jt = mr.getJobTrackerRunner().getJobTracker();
+    for (TaskInProgress taskInProgress : jt.getJob(id).getMapTasks()) {
+      testTaskStatuses(taskInProgress.getTaskStatuses());
+    }
+    
   }
   
+  private void testTaskStatuses(TaskStatus[] tasks) {
+    for (TaskStatus status : tasks) {
+      assertTrue("Invalid start time " + status.getStartTime(), 
+                 status.getStartTime() > 0);
+      assertTrue("Invalid finish time " + status.getFinishTime(), 
+                 status.getFinishTime() > 0);
+      assertTrue("Start time (" + status.getStartTime() + ") is greater than " 
+                 + "the finish time (" + status.getFinishTime() + ")", 
+                 status.getStartTime() <= status.getFinishTime());
+      assertNotNull("Task phase information is null", status.getPhase());
+      assertNotNull("Task run-state information is null", status.getRunState());
+      assertNotNull("TaskTracker information is null", status.getTaskTracker());
+    }
+  }
+
   public void testLostTracker() throws IOException {
     String namenode = null;
     MiniDFSCluster dfs = null;



Mime
View raw message