Пример #1
0
 public virtual void AddApplicationAttempt(ApplicationAttemptId appAttemptId, bool
                                           transferStateFromPreviousAttempt, bool isAttemptRecovering)
 {
     lock (this)
     {
         SchedulerApplication <FiCaSchedulerApp> application = applications[appAttemptId.GetApplicationId
                                                                                ()];
         string user = application.GetUser();
         // TODO: Fix store
         FiCaSchedulerApp schedulerApp = new FiCaSchedulerApp(appAttemptId, user, DefaultQueue
                                                              , activeUsersManager, this.rmContext);
         if (transferStateFromPreviousAttempt)
         {
             schedulerApp.TransferStateFromPreviousAttempt(application.GetCurrentAppAttempt());
         }
         application.SetCurrentAppAttempt(schedulerApp);
         metrics.SubmitAppAttempt(user);
         Log.Info("Added Application Attempt " + appAttemptId + " to scheduler from user "
                  + application.GetUser());
         if (isAttemptRecovering)
         {
             if (Log.IsDebugEnabled())
             {
                 Log.Debug(appAttemptId + " is recovering. Skipping notifying ATTEMPT_ADDED");
             }
         }
         else
         {
             rmContext.GetDispatcher().GetEventHandler().Handle(new RMAppAttemptEvent(appAttemptId
                                                                                      , RMAppAttemptEventType.AttemptAdded));
         }
     }
 }
Пример #2
0
 private void DoneApplication(ApplicationId applicationId, RMAppState finalState)
 {
     lock (this)
     {
         SchedulerApplication <FiCaSchedulerApp> application = applications[applicationId];
         if (application == null)
         {
             Log.Warn("Couldn't find application " + applicationId);
             return;
         }
         // Inform the activeUsersManager
         activeUsersManager.DeactivateApplication(application.GetUser(), applicationId);
         application.Stop(finalState);
         Sharpen.Collections.Remove(applications, applicationId);
     }
 }