Parcourir la source

MAPREDUCE-6383. Pi job (QuasiMonteCarlo) should not try to read the
results file if its job fails. Contributed by Harsh J.

Devaraj K il y a 10 ans
Parent
commit
09b8241e6e

+ 3 - 0
hadoop-mapreduce-project/CHANGES.txt

@@ -337,6 +337,9 @@ Release 2.8.0 - UNRELEASED
     MAPREDUCE-6174. Combine common stream code into parent class for
     InMemoryMapOutput and OnDiskMapOutput. (Eric Payne via gera)
 
+    MAPREDUCE-6383. Pi job (QuasiMonteCarlo) should not try to read the 
+    results file if its job fails. (Harsh J via devaraj)
+
   OPTIMIZATIONS
 
   BUG FIXES

+ 4 - 0
hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/QuasiMonteCarlo.java

@@ -304,6 +304,10 @@ public class QuasiMonteCarlo extends Configured implements Tool {
       System.out.println("Starting Job");
       final long startTime = System.currentTimeMillis();
       job.waitForCompletion(true);
+      if (!job.isSuccessful()) {
+        System.out.println("Job " + job.getJobID() + " failed!");
+        System.exit(1);
+      }
       final double duration = (System.currentTimeMillis() - startTime)/1000.0;
       System.out.println("Job Finished in " + duration + " seconds");