Esempio n. 1
0
 public PartialJob(JobIndexInfo jobIndexInfo, JobId jobId)
 {
     this.jobIndexInfo = jobIndexInfo;
     this.jobId        = jobId;
     jobReport         = RecordFactoryProvider.GetRecordFactory(null).NewRecordInstance <JobReport
                                                                                         >();
     jobReport.SetSubmitTime(jobIndexInfo.GetSubmitTime());
     jobReport.SetStartTime(jobIndexInfo.GetJobStartTime());
     jobReport.SetFinishTime(jobIndexInfo.GetFinishTime());
     jobReport.SetJobState(GetState());
 }
Esempio n. 2
0
        public static JobReport NewJobReport(JobId id)
        {
            JobReport report = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <JobReport>();

            report.SetJobId(id);
            report.SetSubmitTime(Runtime.CurrentTimeMillis() - Dt);
            report.SetStartTime(Runtime.CurrentTimeMillis() - (int)(Math.Random() * Dt));
            report.SetFinishTime(Runtime.CurrentTimeMillis() + (int)(Math.Random() * Dt) + 1);
            report.SetMapProgress((float)Math.Random());
            report.SetReduceProgress((float)Math.Random());
            report.SetJobState(JobStates.Next());
            return(report);
        }
Esempio n. 3
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. 4
0
            /// <exception cref="System.IO.IOException"/>
            public virtual GetJobReportResponse GetJobReport(GetJobReportRequest request)
            {
                this._enclosing.amContact = true;
                JobReport jobReport = TestClientRedirect.recordFactory.NewRecordInstance <JobReport
                                                                                          >();

                jobReport.SetJobId(request.GetJobId());
                jobReport.SetJobState(JobState.Running);
                jobReport.SetJobName("TestClientRedirect-jobname");
                jobReport.SetUser("TestClientRedirect-user");
                jobReport.SetStartTime(0L);
                jobReport.SetFinishTime(1L);
                GetJobReportResponse response = TestClientRedirect.recordFactory.NewRecordInstance
                                                <GetJobReportResponse>();

                response.SetJobReport(jobReport);
                return(response);
            }
Esempio n. 5
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());
        }
Esempio n. 6
0
        public virtual void TestFromYarnJobReport()
        {
            int           jobStartTime  = 612354;
            int           jobFinishTime = 612355;
            JobState      state         = JobState.Running;
            JobId         jobId         = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <JobId>();
            JobReport     jobReport     = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <JobReport>();
            ApplicationId applicationId = ApplicationId.NewInstance(0, 0);

            jobId.SetAppId(applicationId);
            jobId.SetId(0);
            jobReport.SetJobId(jobId);
            jobReport.SetJobState(state);
            jobReport.SetStartTime(jobStartTime);
            jobReport.SetFinishTime(jobFinishTime);
            jobReport.SetUser("TestTypeConverter-user");
            JobStatus jobStatus = TypeConverter.FromYarn(jobReport, "dummy-jobfile");

            NUnit.Framework.Assert.AreEqual(jobStartTime, jobStatus.GetStartTime());
            NUnit.Framework.Assert.AreEqual(jobFinishTime, jobStatus.GetFinishTime());
            NUnit.Framework.Assert.AreEqual(state.ToString(), jobStatus.GetState().ToString()
                                            );
        }
Esempio n. 7
0
        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);
        }