示例#1
0
        // acls not being checked since
        // we are using mock job instead of CompletedJob
        public static void VerifyHsJobGeneric(Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job
                                              job, string id, string user, string name, string state, string queue, long startTime
                                              , long finishTime, int mapsTotal, int mapsCompleted, int reducesTotal, int reducesCompleted
                                              )
        {
            JobReport report = job.GetReport();

            WebServicesTestUtils.CheckStringMatch("id", MRApps.ToString(job.GetID()), id);
            WebServicesTestUtils.CheckStringMatch("user", job.GetUserName().ToString(), user);
            WebServicesTestUtils.CheckStringMatch("name", job.GetName(), name);
            WebServicesTestUtils.CheckStringMatch("state", job.GetState().ToString(), state);
            WebServicesTestUtils.CheckStringMatch("queue", job.GetQueueName(), queue);
            NUnit.Framework.Assert.AreEqual("startTime incorrect", report.GetStartTime(), startTime
                                            );
            NUnit.Framework.Assert.AreEqual("finishTime incorrect", report.GetFinishTime(), finishTime
                                            );
            NUnit.Framework.Assert.AreEqual("mapsTotal incorrect", job.GetTotalMaps(), mapsTotal
                                            );
            NUnit.Framework.Assert.AreEqual("mapsCompleted incorrect", job.GetCompletedMaps()
                                            , mapsCompleted);
            NUnit.Framework.Assert.AreEqual("reducesTotal incorrect", job.GetTotalReduces(),
                                            reducesTotal);
            NUnit.Framework.Assert.AreEqual("reducesCompleted incorrect", job.GetCompletedReduces
                                                (), reducesCompleted);
        }
示例#2
0
        public MockAppContext(int appid, int numTasks, int numAttempts, Path confPath)
        {
            appID        = MockJobs.NewAppID(appid);
            appAttemptID = ApplicationAttemptId.NewInstance(appID, 0);
            IDictionary <JobId, Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job> map = Maps.NewHashMap
                                                                                      ();

            Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = MockJobs.NewJob(appID, 0, numTasks
                                                                             , numAttempts, confPath);
            map[job.GetID()] = job;
            jobs             = map;
        }
 private Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job LoadJob(HistoryFileManager.HistoryFileInfo
                                                            fileInfo)
 {
     try
     {
         Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = fileInfo.LoadJob();
         if (Log.IsDebugEnabled())
         {
             Log.Debug("Adding " + job.GetID() + " to loaded job cache");
         }
         // We can clobber results here, but that should be OK, because it only
         // means that we may have two identical copies of the same job floating
         // around for a while.
         loadedJobCache[job.GetID()] = job;
         return(job);
     }
     catch (IOException e)
     {
         throw new YarnRuntimeException("Could not find/load job: " + fileInfo.GetJobId(),
                                        e);
     }
 }