Пример #1
0
 /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
 /// <exception cref="System.IO.IOException"/>
 public override ApplicationAttemptReport GetApplicationAttemptReport(ApplicationAttemptId
                                                                      appAttemptId)
 {
     try
     {
         GetApplicationAttemptReportRequest request = Org.Apache.Hadoop.Yarn.Util.Records.
                                                      NewRecord <GetApplicationAttemptReportRequest>();
         request.SetApplicationAttemptId(appAttemptId);
         GetApplicationAttemptReportResponse response = rmClient.GetApplicationAttemptReport
                                                            (request);
         return(response.GetApplicationAttemptReport());
     }
     catch (YarnException e)
     {
         if (!historyServiceEnabled)
         {
             // Just throw it as usual if historyService is not enabled.
             throw;
         }
         // Even if history-service is enabled, treat all exceptions still the same
         // except the following
         if (e.GetType() != typeof(ApplicationNotFoundException))
         {
             throw;
         }
         return(historyClient.GetApplicationAttemptReport(appAttemptId));
     }
 }
Пример #2
0
 /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
 /// <exception cref="System.IO.IOException"/>
 public override ApplicationAttemptReport GetApplicationAttemptReport(ApplicationAttemptId
                                                                      appAttemptId)
 {
     Org.Mockito.Mockito.When(mockAttemptResponse.GetApplicationAttemptReport()).ThenReturn
         (GetAttempt(appAttemptId));
     return(base.GetApplicationAttemptReport(appAttemptId));
 }
Пример #3
0
        /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
        /// <exception cref="System.IO.IOException"/>
        public override ApplicationAttemptReport GetApplicationAttemptReport(ApplicationAttemptId
                                                                             applicationAttemptId)
        {
            GetApplicationAttemptReportRequest request = GetApplicationAttemptReportRequest.NewInstance
                                                             (applicationAttemptId);
            GetApplicationAttemptReportResponse response = ahsClient.GetApplicationAttemptReport
                                                               (request);

            return(response.GetApplicationAttemptReport());
        }
Пример #4
0
        public virtual void TestApplicationAttemptReport()
        {
            ApplicationId        appId                 = ApplicationId.NewInstance(0, 1);
            ApplicationAttemptId appAttemptId          = ApplicationAttemptId.NewInstance(appId, 1);
            GetApplicationAttemptReportRequest request = GetApplicationAttemptReportRequest.NewInstance
                                                             (appAttemptId);
            GetApplicationAttemptReportResponse response = clientService.GetApplicationAttemptReport
                                                               (request);
            ApplicationAttemptReport attemptReport = response.GetApplicationAttemptReport();

            NUnit.Framework.Assert.IsNotNull(attemptReport);
            NUnit.Framework.Assert.AreEqual("appattempt_0_0001_000001", attemptReport.GetApplicationAttemptId
                                                ().ToString());
        }