/// <exception cref="System.IO.IOException"/>
        private ApplicationReport ConvertToApplicationReport(ApplicationHistoryData appHistory
                                                             )
        {
            ApplicationAttemptId currentApplicationAttemptId = null;
            string trackingUrl = Unavailable;
            string host        = Unavailable;
            int    rpcPort     = -1;
            ApplicationAttemptHistoryData lastAttempt = GetLastAttempt(appHistory.GetApplicationId
                                                                           ());

            if (lastAttempt != null)
            {
                currentApplicationAttemptId = lastAttempt.GetApplicationAttemptId();
                trackingUrl = lastAttempt.GetTrackingURL();
                host        = lastAttempt.GetHost();
                rpcPort     = lastAttempt.GetRPCPort();
            }
            return(ApplicationReport.NewInstance(appHistory.GetApplicationId(), currentApplicationAttemptId
                                                 , appHistory.GetUser(), appHistory.GetQueue(), appHistory.GetApplicationName(),
                                                 host, rpcPort, null, appHistory.GetYarnApplicationState(), appHistory.GetDiagnosticsInfo
                                                     (), trackingUrl, appHistory.GetStartTime(), appHistory.GetFinishTime(), appHistory
                                                 .GetFinalApplicationStatus(), null, string.Empty, 100, appHistory.GetApplicationType
                                                     (), null));
        }