Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        /// <summary>Runs memory and time benchmark with Mock MRApp.</summary>
        /// <exception cref="System.Exception"/>
        public virtual void Run(MRApp app)
        {
            Logger rootLogger = LogManager.GetRootLogger();

            rootLogger.SetLevel(Level.Warn);
            long startTime = Runtime.CurrentTimeMillis();

            Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = app.Submit(new Configuration());
            while (!job.GetReport().GetJobState().Equals(JobState.Succeeded))
            {
                PrintStat(job, startTime);
                Sharpen.Thread.Sleep(2000);
            }
            PrintStat(job, startTime);
        }