Example usage for org.apache.hadoop.mapreduce.lib.jobcontrol JobControl getRunningJobList

List of usage examples for org.apache.hadoop.mapreduce.lib.jobcontrol JobControl getRunningJobList

Introduction

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

Prototype

public List<ControlledJob> getRunningJobList() 

Source Link

Usage

From source file:ml.shifu.guagua.mapreduce.GuaguaMapReduceClient.java

License:Apache License

/**
 * Compute the progress of the current job submitted through the JobControl object jc to the JobClient jobClient
 * /*ww w  . j a v a  2 s.co m*/
 * @param jc
 *            The JobControl object that has been submitted
 * @param jobClient
 *            The JobClient to which it has been submitted
 * @return The progress as a percentage in double format
 * @throws IOException
 *             In case any IOException connecting to JobTracker.
 */
protected double calculateProgress(JobControl jc, JobClient jobClient) throws IOException {
    double prog = 0.0;
    prog += jc.getSuccessfulJobList().size();

    List<ControlledJob> runnJobs = jc.getRunningJobList();
    for (ControlledJob cjob : runnJobs) {
        prog += progressOfRunningJob(cjob, jobClient);
    }
    return prog;
}