You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by hi...@apache.org on 2013/07/11 07:08:56 UTC

git commit: TEZ-292. Fix MRRSleepJob to work in a map-only job mode. (hitesh)

Updated Branches:
  refs/heads/master b239ebd78 -> 188dc9d9d


TEZ-292. Fix MRRSleepJob to work in a map-only job mode. (hitesh)


Project: http://git-wip-us.apache.org/repos/asf/incubator-tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tez/commit/188dc9d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tez/tree/188dc9d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tez/diff/188dc9d9

Branch: refs/heads/master
Commit: 188dc9d9d683ba841f8a531786cb70119166961f
Parents: b239ebd
Author: Hitesh Shah <hi...@apache.org>
Authored: Wed Jul 10 22:08:35 2013 -0700
Committer: Hitesh Shah <hi...@apache.org>
Committed: Wed Jul 10 22:08:35 2013 -0700

----------------------------------------------------------------------
 .../java/org/apache/tez/mapreduce/examples/MRRSleepJob.java | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/188dc9d9/tez-mapreduce-examples/src/main/java/org/apache/tez/mapreduce/examples/MRRSleepJob.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce-examples/src/main/java/org/apache/tez/mapreduce/examples/MRRSleepJob.java b/tez-mapreduce-examples/src/main/java/org/apache/tez/mapreduce/examples/MRRSleepJob.java
index 1cb4cd1..6b9c2b0 100644
--- a/tez-mapreduce-examples/src/main/java/org/apache/tez/mapreduce/examples/MRRSleepJob.java
+++ b/tez-mapreduce-examples/src/main/java/org/apache/tez/mapreduce/examples/MRRSleepJob.java
@@ -423,6 +423,10 @@ public class MRRSleepJob extends Configured implements Tool {
         SleepInputFormat.class.getName());
     mapStageConf.set(MRJobConfig.PARTITIONER_CLASS_ATTR,
         MRRSleepJobPartitioner.class.getName());
+    if (numIReducer == 0 && numReducer == 0) {
+      mapStageConf.set(MRJobConfig.OUTPUT_FORMAT_CLASS_ATTR,
+          NullOutputFormat.class.getName());
+    }
 
     MultiStageMRConfToTezTranslator.translateVertexConfToTez(mapStageConf,
         null);
@@ -694,6 +698,11 @@ public class MRRSleepJob extends Configured implements Tool {
       }
     }
 
+    if (numIReducer > 0 && numReducer <= 0) {
+      throw new RuntimeException("Cannot have intermediate reduces without"
+          + " a final reduce");
+    }
+
     // sleep for *SleepTime duration in Task by recSleepTime per record
     mapSleepCount = (int)Math.ceil(mapSleepTime / ((double)recSleepTime));
     reduceSleepCount = (int)Math.ceil(reduceSleepTime / ((double)recSleepTime));