You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/04 04:51:36 UTC

svn commit: r1077204 - /hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/Task.java

Author: omalley
Date: Fri Mar  4 03:51:36 2011
New Revision: 1077204

URL: http://svn.apache.org/viewvc?rev=1077204&view=rev
Log:
commit 58862bb4d93e82c4e44519369cec1d301892624a
Author: Hemanth Yamijala <yhemanth@friendchild-lm.(none)>
Date:   Tue Feb 23 22:38:02 2010 +0530

    MAPREDUCE:1476 from https://issues.apache.org/jira/secure/attachment/12436722/mr-1476-y20.patch
    
    +++ b/YAHOO-CHANGES.txt
    +    MAPREDUCE-1476. Fix the M/R framework to not call commit for special
    +    tasks like job setup/cleanup and task cleanup.
    +    (Amareshwari Sriramadasu via yhemanth)
    +

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/Task.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/Task.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/Task.java?rev=1077204&r1=1077203&r2=1077204&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/Task.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/Task.java Fri Mar  4 03:51:36 2011
@@ -736,8 +736,7 @@ abstract public class Task implements Wr
              + " And is in the process of commiting");
     updateCounters();
 
-    // check whether the commit is required.
-    boolean commitRequired = committer.needsTaskCommit(taskContext);
+    boolean commitRequired = isCommitRequired();
     if (commitRequired) {
       int retries = MAX_RETRIES;
       setState(TaskStatus.State.COMMIT_PENDING);
@@ -766,6 +765,22 @@ abstract public class Task implements Wr
     sendDone(umbilical);
   }
 
+  /**
+   * Checks if this task has anything to commit, depending on the
+   * type of task, as well as on whether the {@link OutputCommitter}
+   * has anything to commit.
+   * 
+   * @return true if the task has to commit
+   * @throws IOException
+   */
+  boolean isCommitRequired() throws IOException {
+    boolean commitRequired = false;
+    if (isMapOrReduce()) {
+      commitRequired = committer.needsTaskCommit(taskContext);
+    }
+    return commitRequired;
+  }
+
   protected void statusUpdate(TaskUmbilicalProtocol umbilical) 
   throws IOException {
     int retries = MAX_RETRIES;