hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r508583 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/JobInProgress.java src/test/org/apache/hadoop/mapred/TestEmptyJobWithDFS.java
Date Fri, 16 Feb 2007 21:18:28 GMT
Author: cutting
Date: Fri Feb 16 13:18:27 2007
New Revision: 508583

URL: http://svn.apache.org/viewvc?view=rev&rev=508583
Log:
HADOOP-649.  Fix so that jobs with no tasks are not lost.  Contributed by Thomas Friol.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobInProgress.java
    lucene/hadoop/trunk/src/test/org/apache/hadoop/mapred/TestEmptyJobWithDFS.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=508583&r1=508582&r2=508583
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Fri Feb 16 13:18:27 2007
@@ -53,6 +53,9 @@
     to track down a problem that was appearing as a
     NullPointerException.  (Dhruba Borthakur via cutting) 
 
+16. HADOOP-649.  Fix so that jobs with no tasks are not lost.
+    (Thomas Friol via cutting)
+
 
 Branch 0.11 (unreleased)
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobInProgress.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobInProgress.java?view=diff&rev=508583&r1=508582&r2=508583
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobInProgress.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobInProgress.java Fri Feb 16 13:18:27
2007
@@ -146,6 +146,9 @@
         
         // if no split is returned, job is considered completed and successful
         if (numMapTasks == 0) {
+            // Finished time need to be setted here to prevent this job to be retired
+            // from the job tracker jobs at the next retire iteration.
+            this.finishTime = System.currentTimeMillis();
             this.status = new JobStatus(status.getJobId(), 1.0f, 1.0f, JobStatus.SUCCEEDED);
             tasksInited = true;
             return;

Modified: lucene/hadoop/trunk/src/test/org/apache/hadoop/mapred/TestEmptyJobWithDFS.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/test/org/apache/hadoop/mapred/TestEmptyJobWithDFS.java?view=diff&rev=508583&r1=508582&r2=508583
==============================================================================
--- lucene/hadoop/trunk/src/test/org/apache/hadoop/mapred/TestEmptyJobWithDFS.java (original)
+++ lucene/hadoop/trunk/src/test/org/apache/hadoop/mapred/TestEmptyJobWithDFS.java Fri Feb
16 13:18:27 2007
@@ -92,6 +92,15 @@
               break;
           }
       }
+      
+      try {
+          assertTrue(runningJob.isComplete());
+          assertTrue(runningJob.isSuccessful());
+      } catch (NullPointerException npe) {
+          // This NPE should no more happens
+          fail("A NPE should not have happened.");
+      }
+          
       // return job result
       LOG.info("job is complete: " + runningJob.isSuccessful());
       return (runningJob.isSuccessful());



Mime
View raw message