MAPREDUCE-6383. Pi job (QuasiMonteCarlo) should not try to read the

results file if its job fails. Contributed by Harsh J.
This commit is contained in:
Devaraj K 2015-06-05 21:22:47 +05:30
parent 790a861766
commit 09b8241e6e
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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");