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

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

Introduction

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

Prototype

public long getStartTime() 

Source Link

Document

Get start time of task.

Usage

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

License:Apache License

/**
 * check the status of a task/*  ww  w.j a  va 2s.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;
}