public SchedulerApplicationAttempt(ApplicationAttemptId applicationAttemptId, string user, Queue queue, ActiveUsersManager activeUsersManager, RMContext rmContext) { // This pendingRelease is used in work-preserving recovery scenario to keep // track of the AM's outstanding release requests. RM on recovery could // receive the release request form AM before it receives the container status // from NM for recovery. In this case, the to-be-recovered containers reported // by NM should not be recovered. // Time of the last container scheduled at the current allowed level Preconditions.CheckNotNull(rmContext, "RMContext should not be null"); this.rmContext = rmContext; this.appSchedulingInfo = new AppSchedulingInfo(applicationAttemptId, user, queue, activeUsersManager, rmContext.GetEpoch()); this.queue = queue; this.pendingRelease = new HashSet <ContainerId>(); this.attemptId = applicationAttemptId; if (rmContext.GetRMApps() != null && rmContext.GetRMApps().Contains(applicationAttemptId .GetApplicationId())) { ApplicationSubmissionContext appSubmissionContext = rmContext.GetRMApps()[applicationAttemptId .GetApplicationId()].GetApplicationSubmissionContext(); if (appSubmissionContext != null) { unmanagedAM = appSubmissionContext.GetUnmanagedAM(); this.logAggregationContext = appSubmissionContext.GetLogAggregationContext(); } } }