public virtual void TestTaskAttemptUnsuccessfulCompletionWithoutCounters0239() { Path histPath = new Path(GetType().GetClassLoader().GetResource("job_0.23.9-FAILED.jhist" ).GetFile()); JobHistoryParser parser = new JobHistoryParser(FileSystem.GetLocal(new Configuration ()), histPath); JobHistoryParser.JobInfo jobInfo = parser.Parse(); Log.Info(" job info: " + jobInfo.GetJobname() + " " + jobInfo.GetFinishedMaps() + " " + jobInfo.GetTotalMaps() + " " + jobInfo.GetJobId()); }
// Computes finished maps similar to RecoveryService... private long ComputeFinishedMaps(JobHistoryParser.JobInfo jobInfo, int numMaps, int numSuccessfulMaps) { if (numMaps == numSuccessfulMaps) { return(jobInfo.GetFinishedMaps()); } long numFinishedMaps = 0; IDictionary <TaskID, JobHistoryParser.TaskInfo> taskInfos = jobInfo.GetAllTasks(); foreach (JobHistoryParser.TaskInfo taskInfo in taskInfos.Values) { if (TaskState.Succeeded.ToString().Equals(taskInfo.GetTaskStatus())) { ++numFinishedMaps; } } return(numFinishedMaps); }
public virtual int GetCompletedMaps() { return((int)jobInfo.GetFinishedMaps()); }