private void HandleAMStartedEvent(AMStartedEvent @event)
 {
     JobHistoryParser.AMInfo amInfo = new JobHistoryParser.AMInfo();
     amInfo.appAttemptId        = @event.GetAppAttemptId();
     amInfo.startTime           = @event.GetStartTime();
     amInfo.containerId         = @event.GetContainerId();
     amInfo.nodeManagerHost     = StringInterner.WeakIntern(@event.GetNodeManagerHost());
     amInfo.nodeManagerPort     = @event.GetNodeManagerPort();
     amInfo.nodeManagerHttpPort = @event.GetNodeManagerHttpPort();
     if (info.amInfos == null)
     {
         info.amInfos = new List <JobHistoryParser.AMInfo>();
     }
     info.amInfos.AddItem(amInfo);
     info.latestAmInfo = amInfo;
 }
Exemple #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);
        }