protected override void Dispatch(Org.Apache.Hadoop.Yarn.Event.Event @event) { if (@event is WritingApplicationHistoryEvent) { WritingApplicationHistoryEvent ashEvent = (WritingApplicationHistoryEvent)@event; switch (ashEvent.GetType()) { case WritingHistoryEventType.AppStart: { IncrementCounts(((WritingApplicationStartEvent)@event).GetApplicationId()); break; } case WritingHistoryEventType.AppFinish: { IncrementCounts(((WritingApplicationFinishEvent)@event).GetApplicationId()); break; } case WritingHistoryEventType.AppAttemptStart: { IncrementCounts(((WritingApplicationAttemptStartEvent)@event).GetApplicationAttemptId ().GetApplicationId()); break; } case WritingHistoryEventType.AppAttemptFinish: { IncrementCounts(((WritingApplicationAttemptFinishEvent)@event).GetApplicationAttemptId ().GetApplicationId()); break; } case WritingHistoryEventType.ContainerStart: { IncrementCounts(((WritingContainerStartEvent)@event).GetContainerId().GetApplicationAttemptId ().GetApplicationId()); break; } case WritingHistoryEventType.ContainerFinish: { IncrementCounts(((WritingContainerFinishEvent)@event).GetContainerId().GetApplicationAttemptId ().GetApplicationId()); break; } } } base.Dispatch(@event); }
protected internal virtual void HandleWritingApplicationHistoryEvent(WritingApplicationHistoryEvent @event) { switch (@event.GetType()) { case WritingHistoryEventType.AppStart: { WritingApplicationStartEvent wasEvent = (WritingApplicationStartEvent)@event; try { writer.ApplicationStarted(wasEvent.GetApplicationStartData()); Log.Info("Stored the start data of application " + wasEvent.GetApplicationId()); } catch (IOException) { Log.Error("Error when storing the start data of application " + wasEvent.GetApplicationId ()); } break; } case WritingHistoryEventType.AppFinish: { WritingApplicationFinishEvent wafEvent = (WritingApplicationFinishEvent)@event; try { writer.ApplicationFinished(wafEvent.GetApplicationFinishData()); Log.Info("Stored the finish data of application " + wafEvent.GetApplicationId()); } catch (IOException) { Log.Error("Error when storing the finish data of application " + wafEvent.GetApplicationId ()); } break; } case WritingHistoryEventType.AppAttemptStart: { WritingApplicationAttemptStartEvent waasEvent = (WritingApplicationAttemptStartEvent )@event; try { writer.ApplicationAttemptStarted(waasEvent.GetApplicationAttemptStartData()); Log.Info("Stored the start data of application attempt " + waasEvent.GetApplicationAttemptId ()); } catch (IOException) { Log.Error("Error when storing the start data of application attempt " + waasEvent .GetApplicationAttemptId()); } break; } case WritingHistoryEventType.AppAttemptFinish: { WritingApplicationAttemptFinishEvent waafEvent = (WritingApplicationAttemptFinishEvent )@event; try { writer.ApplicationAttemptFinished(waafEvent.GetApplicationAttemptFinishData()); Log.Info("Stored the finish data of application attempt " + waafEvent.GetApplicationAttemptId ()); } catch (IOException) { Log.Error("Error when storing the finish data of application attempt " + waafEvent .GetApplicationAttemptId()); } break; } case WritingHistoryEventType.ContainerStart: { WritingContainerStartEvent wcsEvent = (WritingContainerStartEvent)@event; try { writer.ContainerStarted(wcsEvent.GetContainerStartData()); Log.Info("Stored the start data of container " + wcsEvent.GetContainerId()); } catch (IOException) { Log.Error("Error when storing the start data of container " + wcsEvent.GetContainerId ()); } break; } case WritingHistoryEventType.ContainerFinish: { WritingContainerFinishEvent wcfEvent = (WritingContainerFinishEvent)@event; try { writer.ContainerFinished(wcfEvent.GetContainerFinishData()); Log.Info("Stored the finish data of container " + wcfEvent.GetContainerId()); } catch (IOException) { Log.Error("Error when storing the finish data of container " + wcfEvent.GetContainerId ()); } break; } default: { Log.Error("Unknown WritingApplicationHistoryEvent type: " + @event.GetType()); break; } } }