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
        /// <exception cref="System.Exception"/>
        private void PrintStat(Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job, long startTime
                               )
        {
            long currentTime = Runtime.CurrentTimeMillis();

            Runtime.GetRuntime().Gc();
            long mem = Runtime.GetRuntime().TotalMemory() - Runtime.GetRuntime().FreeMemory();

            System.Console.Out.WriteLine("JobState:" + job.GetState() + " CompletedMaps:" + job
                                         .GetCompletedMaps() + " CompletedReduces:" + job.GetCompletedReduces() + " Memory(total-free)(KB):"
                                         + mem / 1024 + " ElapsedTime(ms):" + (currentTime - startTime));
        }