public static JobStatus FromYarn(JobReport jobreport, string trackingUrl) { JobPriority jobPriority = JobPriority.Normal; JobStatus jobStatus = new JobStatus(FromYarn(jobreport.GetJobId()), jobreport.GetSetupProgress (), jobreport.GetMapProgress(), jobreport.GetReduceProgress(), jobreport.GetCleanupProgress (), FromYarn(jobreport.GetJobState()), jobPriority, jobreport.GetUser(), jobreport .GetJobName(), jobreport.GetJobFile(), trackingUrl, jobreport.IsUber()); jobStatus.SetStartTime(jobreport.GetStartTime()); jobStatus.SetFinishTime(jobreport.GetFinishTime()); jobStatus.SetFailureInfo(jobreport.GetDiagnostics()); return(jobStatus); }
/// <exception cref="System.IO.IOException"/> public virtual JobStatus GetJobStatus(JobID oldJobID) { JobId jobId = TypeConverter.ToYarn(oldJobID); GetJobReportRequest request = recordFactory.NewRecordInstance <GetJobReportRequest >(); request.SetJobId(jobId); JobReport report = ((GetJobReportResponse)Invoke("getJobReport", typeof(GetJobReportRequest ), request)).GetJobReport(); JobStatus jobStatus = null; if (report != null) { if (StringUtils.IsEmpty(report.GetJobFile())) { string jobFile = MRApps.GetJobFile(conf, report.GetUser(), oldJobID); report.SetJobFile(jobFile); } string historyTrackingUrl = report.GetTrackingUrl(); string url = StringUtils.IsNotEmpty(historyTrackingUrl) ? historyTrackingUrl : trackingUrl; jobStatus = TypeConverter.FromYarn(report, url); } return(jobStatus); }