/// <exception cref="System.IO.IOException"/> public virtual void ApplicationFinished(ApplicationFinishData appFinish) { FileSystemApplicationHistoryStore.HistoryFileWriter hfWriter = GetHistoryFileWriter (appFinish.GetApplicationId()); System.Diagnostics.Debug.Assert(appFinish is ApplicationFinishDataPBImpl); try { hfWriter.WriteHistoryData(new FileSystemApplicationHistoryStore.HistoryDataKey(appFinish .GetApplicationId().ToString(), FinishDataSuffix), ((ApplicationFinishDataPBImpl )appFinish).GetProto().ToByteArray()); Log.Info("Finish information of application " + appFinish.GetApplicationId() + " is written" ); } catch (IOException e) { Log.Error("Error when writing finish information of application " + appFinish.GetApplicationId (), e); throw; } finally { hfWriter.Close(); Sharpen.Collections.Remove(outstandingWriters, appFinish.GetApplicationId()); } }
/// <exception cref="System.IO.IOException"/> public virtual void ApplicationFinished(ApplicationFinishData appFinish) { ApplicationHistoryData data = applicationData[appFinish.GetApplicationId()]; if (data == null) { throw new IOException("The finish information of application " + appFinish.GetApplicationId () + " is stored before the start" + " information."); } // Make the assumption that YarnApplicationState should not be null if // the finish information is already recorded if (data.GetYarnApplicationState() != null) { throw new IOException("The finish information of application " + appFinish.GetApplicationId () + " is already stored."); } data.SetFinishTime(appFinish.GetFinishTime()); data.SetDiagnosticsInfo(appFinish.GetDiagnosticsInfo()); data.SetFinalApplicationStatus(appFinish.GetFinalApplicationStatus()); data.SetYarnApplicationState(appFinish.GetYarnApplicationState()); }