Ejemplo n.º 1
0
        private void HandleTaskAttemptStartedEvent(TaskAttemptStartedEvent @event)
        {
            TaskAttemptID attemptId = @event.GetTaskAttemptId();

            JobHistoryParser.TaskInfo        taskInfo    = info.tasksMap[@event.GetTaskId()];
            JobHistoryParser.TaskAttemptInfo attemptInfo = new JobHistoryParser.TaskAttemptInfo
                                                               ();
            attemptInfo.startTime           = @event.GetStartTime();
            attemptInfo.attemptId           = @event.GetTaskAttemptId();
            attemptInfo.httpPort            = @event.GetHttpPort();
            attemptInfo.trackerName         = StringInterner.WeakIntern(@event.GetTrackerName());
            attemptInfo.taskType            = @event.GetTaskType();
            attemptInfo.shufflePort         = @event.GetShufflePort();
            attemptInfo.containerId         = @event.GetContainerId();
            taskInfo.attemptsMap[attemptId] = attemptInfo;
        }
Ejemplo n.º 2
0
        /// <summary>Get the next event from the stream</summary>
        /// <returns>the next event</returns>
        /// <exception cref="System.IO.IOException"/>
        public virtual HistoryEvent GetNextEvent()
        {
            Event wrapper;

            try
            {
                wrapper = (Event)reader.Read(null, decoder);
            }
            catch (EOFException)
            {
                // at EOF
                return(null);
            }
            HistoryEvent result;

            switch (wrapper.type)
            {
            case EventType.JobSubmitted:
            {
                result = new JobSubmittedEvent();
                break;
            }

            case EventType.JobInited:
            {
                result = new JobInitedEvent();
                break;
            }

            case EventType.JobFinished:
            {
                result = new JobFinishedEvent();
                break;
            }

            case EventType.JobPriorityChanged:
            {
                result = new JobPriorityChangeEvent();
                break;
            }

            case EventType.JobQueueChanged:
            {
                result = new JobQueueChangeEvent();
                break;
            }

            case EventType.JobStatusChanged:
            {
                result = new JobStatusChangedEvent();
                break;
            }

            case EventType.JobFailed:
            {
                result = new JobUnsuccessfulCompletionEvent();
                break;
            }

            case EventType.JobKilled:
            {
                result = new JobUnsuccessfulCompletionEvent();
                break;
            }

            case EventType.JobError:
            {
                result = new JobUnsuccessfulCompletionEvent();
                break;
            }

            case EventType.JobInfoChanged:
            {
                result = new JobInfoChangeEvent();
                break;
            }

            case EventType.TaskStarted:
            {
                result = new TaskStartedEvent();
                break;
            }

            case EventType.TaskFinished:
            {
                result = new TaskFinishedEvent();
                break;
            }

            case EventType.TaskFailed:
            {
                result = new TaskFailedEvent();
                break;
            }

            case EventType.TaskUpdated:
            {
                result = new TaskUpdatedEvent();
                break;
            }

            case EventType.MapAttemptStarted:
            {
                result = new TaskAttemptStartedEvent();
                break;
            }

            case EventType.MapAttemptFinished:
            {
                result = new MapAttemptFinishedEvent();
                break;
            }

            case EventType.MapAttemptFailed:
            {
                result = new TaskAttemptUnsuccessfulCompletionEvent();
                break;
            }

            case EventType.MapAttemptKilled:
            {
                result = new TaskAttemptUnsuccessfulCompletionEvent();
                break;
            }

            case EventType.ReduceAttemptStarted:
            {
                result = new TaskAttemptStartedEvent();
                break;
            }

            case EventType.ReduceAttemptFinished:
            {
                result = new ReduceAttemptFinishedEvent();
                break;
            }

            case EventType.ReduceAttemptFailed:
            {
                result = new TaskAttemptUnsuccessfulCompletionEvent();
                break;
            }

            case EventType.ReduceAttemptKilled:
            {
                result = new TaskAttemptUnsuccessfulCompletionEvent();
                break;
            }

            case EventType.SetupAttemptStarted:
            {
                result = new TaskAttemptStartedEvent();
                break;
            }

            case EventType.SetupAttemptFinished:
            {
                result = new TaskAttemptFinishedEvent();
                break;
            }

            case EventType.SetupAttemptFailed:
            {
                result = new TaskAttemptUnsuccessfulCompletionEvent();
                break;
            }

            case EventType.SetupAttemptKilled:
            {
                result = new TaskAttemptUnsuccessfulCompletionEvent();
                break;
            }

            case EventType.CleanupAttemptStarted:
            {
                result = new TaskAttemptStartedEvent();
                break;
            }

            case EventType.CleanupAttemptFinished:
            {
                result = new TaskAttemptFinishedEvent();
                break;
            }

            case EventType.CleanupAttemptFailed:
            {
                result = new TaskAttemptUnsuccessfulCompletionEvent();
                break;
            }

            case EventType.CleanupAttemptKilled:
            {
                result = new TaskAttemptUnsuccessfulCompletionEvent();
                break;
            }

            case EventType.AmStarted:
            {
                result = new AMStartedEvent();
                break;
            }

            default:
            {
                throw new RuntimeException("unexpected event type: " + wrapper.type);
            }
            }
            result.SetDatum(wrapper.@event);
            return(result);
        }