Example usage for org.apache.hadoop.mapreduce Job setupProgress

List of usage examples for org.apache.hadoop.mapreduce Job setupProgress

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce Job setupProgress.

Prototype

public float setupProgress() throws IOException 

Source Link

Document

Get the progress of the job's setup-tasks, as a float between 0.0 and 1.0.

Usage

From source file:com.cloudera.oryx.computation.common.JobStep.java

License:Open Source License

/**
 * @return three progress values, in [0,1], as a {@code float[]}, representing setup, mapper and reducer progress
 *//* w w  w  .  j  a va  2 s  .c  o m*/
private float[] determineProgresses() throws IOException, InterruptedException {
    if (exec == null) {
        return null;
    }
    Cluster cluster = new Cluster(getConf());
    try {
        JobID jobID = getJob().getJobID();
        if (jobID == null) {
            return null;
        }
        Job runningJob = cluster.getJob(jobID);
        if (runningJob == null) {
            return null;
        }

        return new float[] { runningJob.setupProgress(), runningJob.mapProgress(),
                runningJob.reduceProgress() };
    } finally {
        cluster.close();
    }
}

From source file:weka.distributed.hadoop.HadoopJob.java

License:Open Source License

/**
 * Print status information for the supplied (running) job
 * /*from  w  ww  .  j  a v a  2  s.co m*/
 * @param job the job to print status info for
 * @throws IOException if a problem occurs
 */
protected void printJobStatus(Job job) throws IOException {
    float setupPercent = job.setupProgress() * 100f;
    float mapPercent = job.mapProgress() * 100f;
    float reducePercent = job.reduceProgress() * 100f;

    String info = getJobName() + " Setup: " + setupPercent + " Map: " + mapPercent + " Reduce: "
            + reducePercent;

    statusMessage(info);
    logMessage(info);
}