public MyRMAppManager(RMContext context, YarnScheduler scheduler, ApplicationMasterService masterService, ApplicationACLsManager applicationACLsManager, Configuration conf ) : base(context, scheduler, masterService, applicationACLsManager, conf) { this.conf = conf; this.rmContext = context; }
public RMAppManager(RMContext context, YarnScheduler scheduler, ApplicationMasterService masterService, ApplicationACLsManager applicationACLsManager, Configuration conf ) { this.rmContext = context; this.scheduler = scheduler; this.masterService = masterService; this.applicationACLsManager = applicationACLsManager; this.conf = conf; this.maxCompletedAppsInMemory = conf.GetInt(YarnConfiguration.RmMaxCompletedApplications , YarnConfiguration.DefaultRmMaxCompletedApplications); this.maxCompletedAppsInStateStore = conf.GetInt(YarnConfiguration.RmStateStoreMaxCompletedApplications , YarnConfiguration.DefaultRmStateStoreMaxCompletedApplications); if (this.maxCompletedAppsInStateStore > this.maxCompletedAppsInMemory) { this.maxCompletedAppsInStateStore = this.maxCompletedAppsInMemory; } }
public virtual void SetUp() { long now = Runtime.CurrentTimeMillis(); rmContext = MockRMContext(1, now - 10); ResourceScheduler scheduler = MockResourceScheduler(); Configuration conf = new Configuration(); ApplicationMasterService masterService = new ApplicationMasterService(rmContext, scheduler); appMonitor = new TestAppManager.TestRMAppManager(this, rmContext, new ClientToAMTokenSecretManagerInRM (), scheduler, masterService, new ApplicationACLsManager(conf), conf); appId = MockApps.NewAppID(1); RecordFactory recordFactory = RecordFactoryProvider.GetRecordFactory(null); asContext = recordFactory.NewRecordInstance <ApplicationSubmissionContext>(); asContext.SetApplicationId(appId); asContext.SetAMContainerSpec(MockContainerLaunchContext(recordFactory)); asContext.SetResource(MockResource()); SetupDispatcher(rmContext, conf); }
/// <exception cref="System.Exception"/> public virtual void TestRMAppSubmitMaxAppAttempts() { int[] globalMaxAppAttempts = new int[] { 10, 1 }; int[][] individualMaxAppAttempts = new int[][] { new int[] { 9, 10, 11, 0 }, new int[] { 1, 10, 0, -1 } }; int[][] expectedNums = new int[][] { new int[] { 9, 10, 10, 10 }, new int[] { 1, 1, 1, 1 } }; for (int i = 0; i < globalMaxAppAttempts.Length; ++i) { for (int j = 0; j < individualMaxAppAttempts.Length; ++j) { ResourceScheduler scheduler = MockResourceScheduler(); Configuration conf = new Configuration(); conf.SetInt(YarnConfiguration.RmAmMaxAttempts, globalMaxAppAttempts[i]); ApplicationMasterService masterService = new ApplicationMasterService(rmContext, scheduler); TestAppManager.TestRMAppManager appMonitor = new TestAppManager.TestRMAppManager( this, rmContext, new ClientToAMTokenSecretManagerInRM(), scheduler, masterService , new ApplicationACLsManager(conf), conf); ApplicationId appID = MockApps.NewAppID(i * 4 + j + 1); asContext.SetApplicationId(appID); if (individualMaxAppAttempts[i][j] != 0) { asContext.SetMaxAppAttempts(individualMaxAppAttempts[i][j]); } appMonitor.SubmitApplication(asContext, "test"); RMApp app = rmContext.GetRMApps()[appID]; NUnit.Framework.Assert.AreEqual("max application attempts doesn't match", expectedNums [i][j], app.GetMaxAppAttempts()); // wait for event to be processed int timeoutSecs = 0; while ((GetAppEventType() == RMAppEventType.Kill) && timeoutSecs++ < 20) { Sharpen.Thread.Sleep(1000); } SetAppEventType(RMAppEventType.Kill); } } }
internal virtual void SetApplicationMasterService(ApplicationMasterService applicationMasterService ) { activeServiceContext.SetApplicationMasterService(applicationMasterService); }
internal virtual void SetApplicationMasterService(ApplicationMasterService applicationMasterService ) { this.applicationMasterService = applicationMasterService; }
public TestRMAppManager(TestAppManager _enclosing, RMContext context, ClientToAMTokenSecretManagerInRM clientToAMSecretManager, YarnScheduler scheduler, ApplicationMasterService masterService , ApplicationACLsManager applicationACLsManager, Configuration conf) : base(context, scheduler, masterService, applicationACLsManager, conf) { this._enclosing = _enclosing; }