浏览代码

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 年之前
父节点
当前提交
9944fe44d9
共有 1 个文件被更改,包括 2 次插入2 次删除
  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);
       }
     }
+    conf.setBooleanIfUnset("mapred.reducer.new-api",
+                           conf.get(oldReduceClass) == null);
     if (numReduces != 0) {
-      conf.setBooleanIfUnset("mapred.reducer.new-api",
-                             conf.get(oldReduceClass) == null);
       if (conf.getUseNewReducer()) {
         String mode = "new reduce API";
         ensureNotSet("mapred.output.format.class", mode);