public virtual void TestApplicationAttemptNotFound() { ApplicationId appId = ApplicationId.NewInstance(0, 1); ApplicationAttemptId appAttemptId = ApplicationAttemptId.NewInstance(appId, MaxApps + 1); GetApplicationAttemptReportRequest request = GetApplicationAttemptReportRequest.NewInstance (appAttemptId); try { GetApplicationAttemptReportResponse response = clientService.GetApplicationAttemptReport (request); NUnit.Framework.Assert.Fail("Exception should have been thrown before we reach here." ); } catch (ApplicationAttemptNotFoundException e) { //This Exception is expected System.Console.Out.WriteLine(e.Message); NUnit.Framework.Assert.IsTrue(e.Message.Contains("doesn't exist in the timeline store" )); } catch (Exception) { NUnit.Framework.Assert.Fail("Undesired exception caught"); } }
/// <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)); } }
/// <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()); }
/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.IO.IOException"/> public override GetApplicationAttemptReportResponse GetApplicationAttemptReport(GetApplicationAttemptReportRequest request) { this._enclosing.ResetStartFailoverFlag(true); // make sure failover has been triggered NUnit.Framework.Assert.IsTrue(this._enclosing.WaittingForFailOver()); // return fake ApplicationAttemptReport return(GetApplicationAttemptReportResponse.NewInstance(this._enclosing.CreateFakeApplicationAttemptReport ())); }
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()); }
/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.IO.IOException"/> public virtual GetApplicationAttemptReportResponse GetApplicationAttemptReport(GetApplicationAttemptReportRequest request) { ApplicationAttemptId appAttemptId = request.GetApplicationAttemptId(); try { GetApplicationAttemptReportResponse response = GetApplicationAttemptReportResponse .NewInstance(history.GetApplicationAttempt(appAttemptId)); return(response); } catch (IOException e) { Log.Error(e.Message, e); throw; } }
/// <exception cref="Com.Google.Protobuf.ServiceException"/> public virtual YarnServiceProtos.GetApplicationAttemptReportResponseProto GetApplicationAttemptReport (RpcController controller, YarnServiceProtos.GetApplicationAttemptReportRequestProto proto) { GetApplicationAttemptReportRequestPBImpl request = new GetApplicationAttemptReportRequestPBImpl (proto); try { GetApplicationAttemptReportResponse response = real.GetApplicationAttemptReport(request ); return(((GetApplicationAttemptReportResponsePBImpl)response).GetProto()); } catch (YarnException e) { throw new ServiceException(e); } catch (IOException e) { throw new ServiceException(e); } }