예제 #1
0
            /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
            protected internal override void SubmitApplication(ApplicationSubmissionContext submissionContext
                                                               , long submitTime, string user)
            {
                //Do nothing, just add the application to RMContext
                RMAppImpl application = new RMAppImpl(submissionContext.GetApplicationId(), this.
                                                      rmContext, this.conf, submissionContext.GetApplicationName(), user, submissionContext
                                                      .GetQueue(), submissionContext, this.rmContext.GetScheduler(), this.rmContext.GetApplicationMasterService
                                                          (), submitTime, submissionContext.GetApplicationType(), submissionContext.GetApplicationTags
                                                          (), null);

                this.rmContext.GetRMApps()[submissionContext.GetApplicationId()] = application;
            }
예제 #2
0
        /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
        private RMAppImpl CreateAndPopulateNewRMApp(ApplicationSubmissionContext submissionContext
                                                    , long submitTime, string user, bool isRecovery)
        {
            ApplicationId   applicationId = submissionContext.GetApplicationId();
            ResourceRequest amReq         = ValidateAndCreateResourceRequest(submissionContext, isRecovery
                                                                             );
            // Create RMApp
            RMAppImpl application = new RMAppImpl(applicationId, rmContext, this.conf, submissionContext
                                                  .GetApplicationName(), user, submissionContext.GetQueue(), submissionContext, this
                                                  .scheduler, this.masterService, submitTime, submissionContext.GetApplicationType
                                                      (), submissionContext.GetApplicationTags(), amReq);

            // Concurrent app submissions with same applicationId will fail here
            // Concurrent app submissions with different applicationIds will not
            // influence each other
            if (rmContext.GetRMApps().PutIfAbsent(applicationId, application) != null)
            {
                string message = "Application with id " + applicationId + " is already present! Cannot add a duplicate!";
                Log.Warn(message);
                throw new YarnException(message);
            }
            // Inform the ACLs Manager
            this.applicationACLsManager.AddApplication(applicationId, submissionContext.GetAMContainerSpec
                                                           ().GetApplicationACLs());
            string appViewACLs = submissionContext.GetAMContainerSpec().GetApplicationACLs()[
                ApplicationAccessType.ViewApp];

            rmContext.GetSystemMetricsPublisher().AppACLsUpdated(application, appViewACLs, Runtime
                                                                 .CurrentTimeMillis());
            return(application);
        }