Example #1
0
        private void VerifyJobReport(JobReport jobReport, JobId jobId)
        {
            IList <AMInfo> amInfos = jobReport.GetAMInfos();

            NUnit.Framework.Assert.AreEqual(1, amInfos.Count);
            AMInfo amInfo = amInfos[0];
            ApplicationAttemptId appAttemptId = ApplicationAttemptId.NewInstance(jobId.GetAppId
                                                                                     (), 1);
            ContainerId amContainerId = ContainerId.NewContainerId(appAttemptId, 1);

            NUnit.Framework.Assert.AreEqual(appAttemptId, amInfo.GetAppAttemptId());
            NUnit.Framework.Assert.AreEqual(amContainerId, amInfo.GetContainerId());
            NUnit.Framework.Assert.IsTrue(jobReport.GetSubmitTime() > 0);
            NUnit.Framework.Assert.IsTrue(jobReport.GetStartTime() > 0 && jobReport.GetStartTime
                                              () >= jobReport.GetSubmitTime());
            NUnit.Framework.Assert.IsTrue(jobReport.GetFinishTime() > 0 && jobReport.GetFinishTime
                                              () >= jobReport.GetStartTime());
        }
Example #2
0
        public JobInfo(Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job)
        {
            this.id = MRApps.ToString(job.GetID());
            JobReport report = job.GetReport();

            this.mapsTotal        = job.GetTotalMaps();
            this.mapsCompleted    = job.GetCompletedMaps();
            this.reducesTotal     = job.GetTotalReduces();
            this.reducesCompleted = job.GetCompletedReduces();
            this.submitTime       = report.GetSubmitTime();
            this.startTime        = report.GetStartTime();
            this.finishTime       = report.GetFinishTime();
            this.name             = job.GetName().ToString();
            this.queue            = job.GetQueueName();
            this.user             = job.GetUserName();
            this.state            = job.GetState().ToString();
            this.acls             = new AList <ConfEntryInfo>();
            if (job is CompletedJob)
            {
                avgMapTime               = 0l;
                avgReduceTime            = 0l;
                avgShuffleTime           = 0l;
                avgMergeTime             = 0l;
                failedReduceAttempts     = 0;
                killedReduceAttempts     = 0;
                successfulReduceAttempts = 0;
                failedMapAttempts        = 0;
                killedMapAttempts        = 0;
                successfulMapAttempts    = 0;
                CountTasksAndAttempts(job);
                this.uberized    = job.IsUber();
                this.diagnostics = string.Empty;
                IList <string> diagnostics = job.GetDiagnostics();
                if (diagnostics != null && !diagnostics.IsEmpty())
                {
                    StringBuilder b = new StringBuilder();
                    foreach (string diag in diagnostics)
                    {
                        b.Append(diag);
                    }
                    this.diagnostics = b.ToString();
                }
                IDictionary <JobACL, AccessControlList> allacls = job.GetJobACLs();
                if (allacls != null)
                {
                    foreach (KeyValuePair <JobACL, AccessControlList> entry in allacls)
                    {
                        this.acls.AddItem(new ConfEntryInfo(entry.Key.GetAclName(), entry.Value.GetAclString
                                                                ()));
                    }
                }
            }
        }