Example usage for org.apache.hadoop.mapreduce TaskReport getCurrentStatus

List of usage examples for org.apache.hadoop.mapreduce TaskReport getCurrentStatus

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce TaskReport getCurrentStatus.

Prototype

public TIPStatus getCurrentStatus() 

Source Link

Document

The current status

Usage

From source file:com.twitter.hraven.hadoopJobMonitor.policy.DefaultPolicy.java

License:Apache License

/**
 * check the status of a task/*from   w w  w .  j  av a2s .  c  o m*/
 * 
 * @param taskType
 * @param taskReport
 * @param appConf
 * @param currTime
 * @return true if task is well-behaved
 */
@Override
public boolean checkTask(ApplicationReport appReport, TaskType taskType, TaskReport taskReport,
        AppConfiguraiton appConf, long currTime) {
    long startTime = taskReport.getStartTime();
    long runTime = currTime - startTime;
    long maxRunTimeMs = appConf.getMaxTaskLenMin(taskType) * 60 * 1000;
    TIPStatus tStatus = taskReport.getCurrentStatus();
    boolean badTask = (tStatus == TIPStatus.RUNNING && runTime > maxRunTimeMs);
    if (badTask)
        return !badTask;
    badTask = !checkProgress(taskReport.getProgress(), appConf.getProgressThreshold(), maxRunTimeMs,
            taskReport.getTaskID(), currTime);
    return !badTask;
}