You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by mc...@apache.org on 2005/07/26 22:31:16 UTC

svn commit: r225387 - in /lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred: MapTask.java TaskTracker.java

Author: mc
Date: Tue Jul 26 13:31:14 2005
New Revision: 225387

URL: http://svn.apache.org/viewcvs?rev=225387&view=rev
Log:

  Fix two problems:

  1)  A task was reporting umbilical.done() even after an
exception was thrown.  That's wrong; umbilical.done() indicates
the task completed successfully.  We now move the call to umbilical.done()
before the exception-handling

  2)  Completed map tasks sometimes had final progress reports that were
vanishingly close to 1.0, but not quite there.  We have a guard in place
that prevented progress reports that are "too small to matter", and the
final progress report would sometimes fall into that category.  We now
remove the guard when progress reports are within epsilon of 1.0.



Modified:
    lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/MapTask.java
    lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/TaskTracker.java

Modified: lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/MapTask.java
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/MapTask.java?rev=225387&r1=225386&r2=225387&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/MapTask.java (original)
+++ lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/MapTask.java Tue Jul 26 13:31:14 2005
@@ -99,7 +99,8 @@
 
             float progress =                        // compute progress
               (float)Math.min((rawIn.getPos()-split.getStart())/end, 1.0f);
-            if ((progress - lastProgress) > 0.01f)  { // 100 progress reports
+            if ((progress - lastProgress) > 0.01f ||
+                progress >= (1.0f - 0.01f))  { // 100 progress reports
               umbilical.progress(getTaskId(), new FloatWritable(progress));
               lastProgress = progress;
             }

Modified: lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/TaskTracker.java
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/TaskTracker.java?rev=225387&r1=225386&r2=225387&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/TaskTracker.java (original)
+++ lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/TaskTracker.java Tue Jul 26 13:31:14 2005
@@ -528,6 +528,7 @@
 
           try {
               task.run(job, umbilical);           // run the task
+              umbilical.done(taskid);
           } catch (Throwable throwable) {
               LOG.log(Level.WARNING, "Failed to spawn child", throwable);
               // Report back any failures, for diagnostic purposes
@@ -535,7 +536,6 @@
               throwable.printStackTrace(new PrintStream(baos));
               umbilical.reportDiagnosticInfo(taskid, baos.toString());
           }
-          umbilical.done(taskid);
         }
 
         /** Periodically ping parent and exit when this fails.*/