/// <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="Com.Google.Protobuf.ServiceException"/> public virtual YarnServiceProtos.GetApplicationAttemptsResponseProto GetApplicationAttempts (RpcController controller, YarnServiceProtos.GetApplicationAttemptsRequestProto proto) { GetApplicationAttemptsRequestPBImpl request = new GetApplicationAttemptsRequestPBImpl (proto); try { GetApplicationAttemptsResponse response = real.GetApplicationAttempts(request); return(((GetApplicationAttemptsResponsePBImpl)response).GetProto()); } catch (YarnException e) { throw new ServiceException(e); } catch (IOException e) { throw new ServiceException(e); } }