Example #1
0
        // pass
        private void VerifyJobReport(JobReport jr)
        {
            NUnit.Framework.Assert.IsNotNull("JobReport is null", jr);
            IList <AMInfo> amInfos = jr.GetAMInfos();

            NUnit.Framework.Assert.AreEqual(1, amInfos.Count);
            NUnit.Framework.Assert.AreEqual(JobState.Running, jr.GetJobState());
            AMInfo amInfo = amInfos[0];

            NUnit.Framework.Assert.AreEqual(MRApp.NmHost, amInfo.GetNodeManagerHost());
            NUnit.Framework.Assert.AreEqual(MRApp.NmPort, amInfo.GetNodeManagerPort());
            NUnit.Framework.Assert.AreEqual(MRApp.NmHttpPort, amInfo.GetNodeManagerHttpPort()
                                            );
            NUnit.Framework.Assert.AreEqual(1, amInfo.GetAppAttemptId().GetAttemptId());
            NUnit.Framework.Assert.AreEqual(1, amInfo.GetContainerId().GetApplicationAttemptId
                                                ().GetAttemptId());
            NUnit.Framework.Assert.IsTrue(amInfo.GetStartTime() > 0);
            NUnit.Framework.Assert.AreEqual(false, jr.IsUber());
        }
Example #2
0
        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);
        }