コード例 #1
0
 /// <exception cref="System.IO.IOException"/>
 public virtual void ApplicationAttemptStarted(ApplicationAttemptStartData appAttemptStart
                                               )
 {
     FileSystemApplicationHistoryStore.HistoryFileWriter hfWriter = GetHistoryFileWriter
                                                                        (appAttemptStart.GetApplicationAttemptId().GetApplicationId());
     System.Diagnostics.Debug.Assert(appAttemptStart is ApplicationAttemptStartDataPBImpl
                                     );
     try
     {
         hfWriter.WriteHistoryData(new FileSystemApplicationHistoryStore.HistoryDataKey(appAttemptStart
                                                                                        .GetApplicationAttemptId().ToString(), StartDataSuffix), ((ApplicationAttemptStartDataPBImpl
                                                                                                                                                   )appAttemptStart).GetProto().ToByteArray());
         Log.Info("Start information of application attempt " + appAttemptStart.GetApplicationAttemptId
                      () + " is written");
     }
     catch (IOException e)
     {
         Log.Error("Error when writing start information of application attempt " + appAttemptStart
                   .GetApplicationAttemptId(), e);
         throw;
     }
 }
コード例 #2
0
        /// <exception cref="System.IO.IOException"/>
        public virtual void ApplicationAttemptStarted(ApplicationAttemptStartData appAttemptStart
                                                      )
        {
            ConcurrentMap <ApplicationAttemptId, ApplicationAttemptHistoryData> subMap = GetSubMap
                                                                                             (appAttemptStart.GetApplicationAttemptId().GetApplicationId());
            ApplicationAttemptHistoryData oldData = subMap.PutIfAbsent(appAttemptStart.GetApplicationAttemptId
                                                                           (), ApplicationAttemptHistoryData.NewInstance(appAttemptStart.GetApplicationAttemptId
                                                                                                                             (), appAttemptStart.GetHost(), appAttemptStart.GetRPCPort(), appAttemptStart.GetMasterContainerId
                                                                                                                             (), null, null, null, null));

            if (oldData != null)
            {
                throw new IOException("The start information of application attempt " + appAttemptStart
                                      .GetApplicationAttemptId() + " is already stored.");
            }
        }