Пример #1
0
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="System.Exception"/>
        public virtual void TestTaskID()
        {
            JobID      jobid   = new JobID("1014873536921", 6);
            TaskID     tid     = new TaskID(jobid, TaskType.Map, 0);
            TaskID     tid1    = TaskID.Downgrade(tid);
            TaskReport treport = new TaskReport(tid1, 0.0f, JobStatus.State.Failed.ToString()
                                                , null, TIPStatus.Failed, 100, 100, new Counters());

            NUnit.Framework.Assert.AreEqual(treport.GetTaskId(), "task_1014873536921_0006_m_000000"
                                            );
            NUnit.Framework.Assert.AreEqual(treport.GetTaskID().ToString(), "task_1014873536921_0006_m_000000"
                                            );
        }
Пример #2
0
        /// <exception cref="System.IO.IOException"/>
        public virtual GetTaskReportResponse GetTaskReport(GetTaskReportRequest request)
        {
            GetTaskReportResponse resp = recordFactory.NewRecordInstance <GetTaskReportResponse
                                                                          >();
            TaskReport report = recordFactory.NewRecordInstance <TaskReport>();

            report.SetTaskId(request.GetTaskId());
            report.SetTaskState(TaskState.New);
            Counters counters = recordFactory.NewRecordInstance <Counters>();

            counters.AddAllCounterGroups(new Dictionary <string, CounterGroup>());
            report.SetCounters(counters);
            report.AddAllRunningAttempts(new AList <TaskAttemptId>());
            return(resp);
        }