protected override void CreateAttemptHeadRoomTable(HtmlBlock.Block html) { RMAppAttempt attempt = GetRMAppAttempt(); if (attempt != null) { if (!IsApplicationInFinalState(YarnApplicationAttemptState.ValueOf(attempt.GetAppAttemptState ().ToString()))) { RMAppAttemptMetrics metrics = attempt.GetRMAppAttemptMetrics(); Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> pdiv = html.(typeof(InfoBlock )).Div(JQueryUI.InfoWrap); Info("Application Attempt Overview").Clear(); Info("Application Attempt Metrics").("Application Attempt Headroom : ", metrics == null ? "N/A" : metrics.GetApplicationAttemptHeadroom()); pdiv.(); } } }
public static YarnApplicationAttemptState ConvertFromProtoFormat(YarnProtos.YarnApplicationAttemptStateProto e) { return(YarnApplicationAttemptState.ValueOf(e.ToString().Replace(YarnApplicationAttemptStatePrefix , string.Empty))); }
private static ApplicationAttemptReport ConvertToApplicationAttemptReport(TimelineEntity entity) { string host = null; int rpcPort = -1; ContainerId amContainerId = null; string trackingUrl = null; string originalTrackingUrl = null; string diagnosticsInfo = null; YarnApplicationAttemptState state = null; IList <TimelineEvent> events = entity.GetEvents(); if (events != null) { foreach (TimelineEvent @event in events) { if (@event.GetEventType().Equals(AppAttemptMetricsConstants.RegisteredEventType)) { IDictionary <string, object> eventInfo = @event.GetEventInfo(); if (eventInfo == null) { continue; } if (eventInfo.Contains(AppAttemptMetricsConstants.HostEventInfo)) { host = eventInfo[AppAttemptMetricsConstants.HostEventInfo].ToString(); } if (eventInfo.Contains(AppAttemptMetricsConstants.RpcPortEventInfo)) { rpcPort = (int)eventInfo[AppAttemptMetricsConstants.RpcPortEventInfo]; } if (eventInfo.Contains(AppAttemptMetricsConstants.MasterContainerEventInfo)) { amContainerId = ConverterUtils.ToContainerId(eventInfo[AppAttemptMetricsConstants .MasterContainerEventInfo].ToString()); } } else { if (@event.GetEventType().Equals(AppAttemptMetricsConstants.FinishedEventType)) { IDictionary <string, object> eventInfo = @event.GetEventInfo(); if (eventInfo == null) { continue; } if (eventInfo.Contains(AppAttemptMetricsConstants.TrackingUrlEventInfo)) { trackingUrl = eventInfo[AppAttemptMetricsConstants.TrackingUrlEventInfo].ToString (); } if (eventInfo.Contains(AppAttemptMetricsConstants.OriginalTrackingUrlEventInfo)) { originalTrackingUrl = eventInfo[AppAttemptMetricsConstants.OriginalTrackingUrlEventInfo ].ToString(); } if (eventInfo.Contains(AppAttemptMetricsConstants.DiagnosticsInfoEventInfo)) { diagnosticsInfo = eventInfo[AppAttemptMetricsConstants.DiagnosticsInfoEventInfo]. ToString(); } if (eventInfo.Contains(AppAttemptMetricsConstants.StateEventInfo)) { state = YarnApplicationAttemptState.ValueOf(eventInfo[AppAttemptMetricsConstants. StateEventInfo].ToString()); } } } } } return(ApplicationAttemptReport.NewInstance(ConverterUtils.ToApplicationAttemptId (entity.GetEntityId()), host, rpcPort, trackingUrl, originalTrackingUrl, diagnosticsInfo , state, amContainerId)); }