/// <exception cref="System.IO.IOException"/>
        public virtual void ApplicationAttemptFinished(ApplicationAttemptFinishData appAttemptFinish
                                                       )
        {
            ConcurrentMap <ApplicationAttemptId, ApplicationAttemptHistoryData> subMap = GetSubMap
                                                                                             (appAttemptFinish.GetApplicationAttemptId().GetApplicationId());
            ApplicationAttemptHistoryData data = subMap[appAttemptFinish.GetApplicationAttemptId
                                                            ()];

            if (data == null)
            {
                throw new IOException("The finish information of application attempt " + appAttemptFinish
                                      .GetApplicationAttemptId() + " is stored before" + " the start information.");
            }
            // Make the assumption that YarnApplicationAttemptState should not be null
            // if the finish information is already recorded
            if (data.GetYarnApplicationAttemptState() != null)
            {
                throw new IOException("The finish information of application attempt " + appAttemptFinish
                                      .GetApplicationAttemptId() + " is already stored.");
            }
            data.SetTrackingURL(appAttemptFinish.GetTrackingURL());
            data.SetDiagnosticsInfo(appAttemptFinish.GetDiagnosticsInfo());
            data.SetFinalApplicationStatus(appAttemptFinish.GetFinalApplicationStatus());
            data.SetYarnApplicationAttemptState(appAttemptFinish.GetYarnApplicationAttemptState
                                                    ());
        }
 private static void MergeApplicationAttemptHistoryData(ApplicationAttemptHistoryData
                                                        historyData, ApplicationAttemptFinishData finishData)
 {
     historyData.SetDiagnosticsInfo(finishData.GetDiagnosticsInfo());
     historyData.SetTrackingURL(finishData.GetTrackingURL());
     historyData.SetFinalApplicationStatus(finishData.GetFinalApplicationStatus());
     historyData.SetYarnApplicationAttemptState(finishData.GetYarnApplicationAttemptState
                                                    ());
 }