Exemplo n.º 1
0
 private void HandleTaskAttemptFinishedEvent(TaskAttemptFinishedEvent @event)
 {
     JobHistoryParser.TaskInfo        taskInfo    = info.tasksMap[@event.GetTaskId()];
     JobHistoryParser.TaskAttemptInfo attemptInfo = taskInfo.attemptsMap[@event.GetAttemptId
                                                                             ()];
     attemptInfo.finishTime = @event.GetFinishTime();
     attemptInfo.status     = StringInterner.WeakIntern(@event.GetTaskStatus());
     attemptInfo.state      = StringInterner.WeakIntern(@event.GetState());
     attemptInfo.counters   = @event.GetCounters();
     attemptInfo.hostname   = StringInterner.WeakIntern(@event.GetHostname());
     info.completedTaskAttemptsMap[@event.GetAttemptId()] = attemptInfo;
 }
Exemplo n.º 2
0
        /// <summary>test a getters of TaskAttemptFinishedEvent and TaskAttemptFinished</summary>
        /// <exception cref="System.Exception"/>
        public virtual void TestTaskAttemptFinishedEvent()
        {
            JobID                    jid           = new JobID("001", 1);
            TaskID                   tid           = new TaskID(jid, TaskType.Reduce, 2);
            TaskAttemptID            taskAttemptId = new TaskAttemptID(tid, 3);
            Counters                 counters      = new Counters();
            TaskAttemptFinishedEvent test          = new TaskAttemptFinishedEvent(taskAttemptId, TaskType
                                                                                  .Reduce, "TEST", 123L, "RAKNAME", "HOSTNAME", "STATUS", counters);

            NUnit.Framework.Assert.AreEqual(test.GetAttemptId().ToString(), taskAttemptId.ToString
                                                ());
            NUnit.Framework.Assert.AreEqual(test.GetCounters(), counters);
            NUnit.Framework.Assert.AreEqual(test.GetFinishTime(), 123L);
            NUnit.Framework.Assert.AreEqual(test.GetHostname(), "HOSTNAME");
            NUnit.Framework.Assert.AreEqual(test.GetRackName(), "RAKNAME");
            NUnit.Framework.Assert.AreEqual(test.GetState(), "STATUS");
            NUnit.Framework.Assert.AreEqual(test.GetTaskId(), tid);
            NUnit.Framework.Assert.AreEqual(test.GetTaskStatus(), "TEST");
            NUnit.Framework.Assert.AreEqual(test.GetTaskType(), TaskType.Reduce);
        }