/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.IO.IOException"/> public override IList <ApplicationAttemptReport> GetApplicationAttempts(ApplicationId appId) { try { GetApplicationAttemptsRequest request = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <GetApplicationAttemptsRequest>(); request.SetApplicationId(appId); GetApplicationAttemptsResponse response = rmClient.GetApplicationAttempts(request ); return(response.GetApplicationAttemptList()); } 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.GetApplicationAttempts(appId)); } }
/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.IO.IOException"/> public override IList <ApplicationAttemptReport> GetApplicationAttempts(ApplicationId appId) { Org.Mockito.Mockito.When(mockAppAttemptsResponse.GetApplicationAttemptList()).ThenReturn (GetAttempts(appId)); return(base.GetApplicationAttempts(appId)); }
/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.IO.IOException"/> public override IList <ApplicationAttemptReport> GetApplicationAttempts(ApplicationId appId) { GetApplicationAttemptsRequest request = GetApplicationAttemptsRequest.NewInstance (appId); GetApplicationAttemptsResponse response = ahsClient.GetApplicationAttempts(request ); return(response.GetApplicationAttemptList()); }
public virtual void TestApplicationAttempts() { ApplicationId appId = ApplicationId.NewInstance(0, 1); ApplicationAttemptId appAttemptId = ApplicationAttemptId.NewInstance(appId, 1); ApplicationAttemptId appAttemptId1 = ApplicationAttemptId.NewInstance(appId, 2); GetApplicationAttemptsRequest request = GetApplicationAttemptsRequest.NewInstance (appId); GetApplicationAttemptsResponse response = clientService.GetApplicationAttempts(request ); IList <ApplicationAttemptReport> attemptReports = response.GetApplicationAttemptList (); NUnit.Framework.Assert.IsNotNull(attemptReports); NUnit.Framework.Assert.AreEqual(appAttemptId, attemptReports[0].GetApplicationAttemptId ()); NUnit.Framework.Assert.AreEqual(appAttemptId1, attemptReports[1].GetApplicationAttemptId ()); }