/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
 /// <exception cref="System.IO.IOException"/>
 private ApplicationHistoryManagerOnTimelineStore.ApplicationReportExt GenerateApplicationReport
     (TimelineEntity entity, ApplicationHistoryManagerOnTimelineStore.ApplicationReportField
     field)
 {
     ApplicationHistoryManagerOnTimelineStore.ApplicationReportExt app = ConvertToApplicationReport
                                                                             (entity, field);
     // If only user and acls are pulled to check attempt(s)/container(s) access
     // control, we can return immediately
     if (field == ApplicationHistoryManagerOnTimelineStore.ApplicationReportField.UserAndAcls)
     {
         return(app);
     }
     try
     {
         CheckAccess(app);
         if (app.appReport.GetCurrentApplicationAttemptId() != null)
         {
             ApplicationAttemptReport appAttempt = GetApplicationAttempt(app.appReport.GetCurrentApplicationAttemptId
                                                                             (), false);
             app.appReport.SetHost(appAttempt.GetHost());
             app.appReport.SetRpcPort(appAttempt.GetRpcPort());
             app.appReport.SetTrackingUrl(appAttempt.GetTrackingUrl());
             app.appReport.SetOriginalTrackingUrl(appAttempt.GetOriginalTrackingUrl());
         }
     }
     catch (Exception)
     {
         // AuthorizationException is thrown because the user doesn't have access
         // It's possible that the app is finished before the first attempt is created.
         app.appReport.SetDiagnostics(null);
         app.appReport.SetCurrentApplicationAttemptId(null);
     }
     if (app.appReport.GetCurrentApplicationAttemptId() == null)
     {
         app.appReport.SetCurrentApplicationAttemptId(ApplicationAttemptId.NewInstance(app
                                                                                       .appReport.GetApplicationId(), -1));
     }
     if (app.appReport.GetHost() == null)
     {
         app.appReport.SetHost(Unavailable);
     }
     if (app.appReport.GetRpcPort() < 0)
     {
         app.appReport.SetRpcPort(-1);
     }
     if (app.appReport.GetTrackingUrl() == null)
     {
         app.appReport.SetTrackingUrl(Unavailable);
     }
     if (app.appReport.GetOriginalTrackingUrl() == null)
     {
         app.appReport.SetOriginalTrackingUrl(Unavailable);
     }
     if (app.appReport.GetDiagnostics() == null)
     {
         app.appReport.SetDiagnostics(string.Empty);
     }
     return(app);
 }
Example #2
0
 public AppAttemptInfo(ApplicationAttemptReport appAttempt)
 {
     // JAXB needs this
     appAttemptId        = appAttempt.GetApplicationAttemptId().ToString();
     host                = appAttempt.GetHost();
     rpcPort             = appAttempt.GetRpcPort();
     trackingUrl         = appAttempt.GetTrackingUrl();
     originalTrackingUrl = appAttempt.GetOriginalTrackingUrl();
     diagnosticsInfo     = appAttempt.GetDiagnostics();
     appAttemptState     = appAttempt.GetYarnApplicationAttemptState();
     if (appAttempt.GetAMContainerId() != null)
     {
         amContainerId = appAttempt.GetAMContainerId().ToString();
     }
 }