Example usage for org.apache.hadoop.mapreduce.lib.jobcontrol ControlledJob getJobName

List of usage examples for org.apache.hadoop.mapreduce.lib.jobcontrol ControlledJob getJobName

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce.lib.jobcontrol ControlledJob getJobName.

Prototype

public String getJobName() 

Source Link

Usage

From source file:com.cloudera.crunch.impl.mr.exec.MRExecutor.java

License:Open Source License

public void execute() {
    try {/*from  w w w . j  a  v  a2  s.  com*/
        Thread controlThread = new Thread(control);
        controlThread.start();
        while (!control.allFinished()) {
            Thread.sleep(1000);
        }
        control.stop();
    } catch (InterruptedException e) {
        LOG.info(e);
    }
    List<ControlledJob> failures = control.getFailedJobList();
    if (!failures.isEmpty()) {
        System.err.println(failures.size() + " job failure(s) occurred:");
        for (ControlledJob job : failures) {
            System.err.println(job.getJobName() + "(" + job.getJobID() + "): " + job.getMessage());
        }
    }
}