Browse Source

MAPREDUCE-6009. Map-only job with new-api runs wrong OutputCommitter when cleanup scheduled in a reduce slot (Gera Shegalov via Sandy Ryza)

Sandy Ryza 10 years ago
parent
commit
9944fe44d9
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/mapred/org/apache/hadoop/mapreduce/Job.java

+ 2 - 2
src/mapred/org/apache/hadoop/mapreduce/Job.java

@@ -521,9 +521,9 @@ public class Job extends JobContext {
         ensureNotSet(JobContext.OUTPUT_FORMAT_CLASS_ATTR, mode);
         ensureNotSet(JobContext.OUTPUT_FORMAT_CLASS_ATTR, mode);
       }
       }
     }
     }
+    conf.setBooleanIfUnset("mapred.reducer.new-api",
+                           conf.get(oldReduceClass) == null);
     if (numReduces != 0) {
     if (numReduces != 0) {
-      conf.setBooleanIfUnset("mapred.reducer.new-api",
-                             conf.get(oldReduceClass) == null);
       if (conf.getUseNewReducer()) {
       if (conf.getUseNewReducer()) {
         String mode = "new reduce API";
         String mode = "new reduce API";
         ensureNotSet("mapred.output.format.class", mode);
         ensureNotSet("mapred.output.format.class", mode);