private Org.Apache.Hadoop.Mapreduce.V2.Api.Protocolrecords.GetJobReportResponse GetJobReportResponseFromHistoryServer () { Org.Apache.Hadoop.Mapreduce.V2.Api.Protocolrecords.GetJobReportResponse jobReportResponse = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <Org.Apache.Hadoop.Mapreduce.V2.Api.Protocolrecords.GetJobReportResponse >(); JobReport jobReport = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <JobReport>(); jobReport.SetJobId(jobId); jobReport.SetJobState(JobState.Succeeded); jobReport.SetMapProgress(1.0f); jobReport.SetReduceProgress(1.0f); jobReport.SetJobFile("TestJobFilePath"); jobReport.SetTrackingUrl("http://TestTrackingUrl"); jobReportResponse.SetJobReport(jobReport); return(jobReportResponse); }
private void ConstructJobReport() { report = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <JobReport>(); report.SetJobId(jobId); report.SetJobState(JobState.ValueOf(jobInfo.GetJobStatus())); report.SetSubmitTime(jobInfo.GetSubmitTime()); report.SetStartTime(jobInfo.GetLaunchTime()); report.SetFinishTime(jobInfo.GetFinishTime()); report.SetJobName(jobInfo.GetJobname()); report.SetUser(jobInfo.GetUsername()); if (GetTotalMaps() == 0) { report.SetMapProgress(1.0f); } else { report.SetMapProgress((float)GetCompletedMaps() / GetTotalMaps()); } if (GetTotalReduces() == 0) { report.SetReduceProgress(1.0f); } else { report.SetReduceProgress((float)GetCompletedReduces() / GetTotalReduces()); } report.SetJobFile(GetConfFile().ToString()); string historyUrl = "N/A"; try { historyUrl = MRWebAppUtil.GetApplicationWebURLOnJHSWithoutScheme(conf, jobId.GetAppId ()); } catch (UnknownHostException) { } //Ignore. report.SetTrackingUrl(historyUrl); report.SetAMInfos(GetAMInfos()); report.SetIsUber(IsUber()); }
public static JobReport NewJobReport(JobId jobId, string jobName, string userName , JobState state, long submitTime, long startTime, long finishTime, float setupProgress , float mapProgress, float reduceProgress, float cleanupProgress, string jobFile , IList <AMInfo> amInfos, bool isUber, string diagnostics) { JobReport report = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <JobReport>(); report.SetJobId(jobId); report.SetJobName(jobName); report.SetUser(userName); report.SetJobState(state); report.SetSubmitTime(submitTime); report.SetStartTime(startTime); report.SetFinishTime(finishTime); report.SetSetupProgress(setupProgress); report.SetCleanupProgress(cleanupProgress); report.SetMapProgress(mapProgress); report.SetReduceProgress(reduceProgress); report.SetJobFile(jobFile); report.SetAMInfos(amInfos); report.SetIsUber(isUber); report.SetDiagnostics(diagnostics); return(report); }
/// <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); }