Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        /// <exception cref="System.IO.IOException"/>
        public virtual GetJobReportResponse GetJobReport(GetJobReportRequest request)
        {
            JobReport jobReport = recordFactory.NewRecordInstance <JobReport>();

            jobReport.SetJobId(request.GetJobId());
            jobReport.SetJobState(jobState);
            jobReport.SetUser(applicationReport.GetUser());
            jobReport.SetStartTime(applicationReport.GetStartTime());
            jobReport.SetDiagnostics(applicationReport.GetDiagnostics());
            jobReport.SetJobName(applicationReport.GetName());
            jobReport.SetTrackingUrl(applicationReport.GetTrackingUrl());
            jobReport.SetFinishTime(applicationReport.GetFinishTime());
            GetJobReportResponse resp = recordFactory.NewRecordInstance <GetJobReportResponse>
                                            ();

            resp.SetJobReport(jobReport);
            return(resp);
        }
Esempio n. 3
0
        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());
        }