Ejemplo n.º 1
0
        /// <exception cref="System.IO.IOException"/>
        protected internal override void StoreApplicationAttemptStateInternal(ApplicationAttemptId
                                                                              attemptId, ApplicationAttemptStateData attemptStateData)
        {
            string key = GetApplicationAttemptNodeKey(attemptId);

            if (Log.IsDebugEnabled())
            {
                Log.Debug("Storing state for attempt " + attemptId + " at " + key);
            }
            try
            {
                db.Put(JniDBFactory.Bytes(key), attemptStateData.GetProto().ToByteArray());
            }
            catch (DBException e)
            {
                throw new IOException(e);
            }
        }
Ejemplo n.º 2
0
 /// <exception cref="System.Exception"/>
 protected internal override void UpdateApplicationAttemptStateInternal(ApplicationAttemptId
                                                                        appAttemptId, ApplicationAttemptStateData attemptStateDataPB)
 {
     lock (this)
     {
         Path appDirPath     = GetAppDir(rmAppRoot, appAttemptId.GetApplicationId());
         Path nodeCreatePath = GetNodePath(appDirPath, appAttemptId.ToString());
         Log.Info("Updating info for attempt: " + appAttemptId + " at: " + nodeCreatePath);
         byte[] attemptStateData = attemptStateDataPB.GetProto().ToByteArray();
         try
         {
             // currently throw all exceptions. May need to respond differently for HA
             // based on whether we have lost the right to write to FS
             UpdateFile(nodeCreatePath, attemptStateData, true);
         }
         catch (Exception e)
         {
             Log.Info("Error updating info for attempt: " + appAttemptId, e);
             throw;
         }
     }
 }