Exemplo n.º 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));
     }
 }
        /// <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);
            }
        }