Esempio n. 1
0
        public virtual void TestMoveRejectedByScheduler()
        {
            failMove = true;
            // Submit application
            Application application = new Application("user1", resourceManager);

            application.Submit();
            // Wait for app to be accepted
            RMApp app = resourceManager.rmContext.GetRMApps()[application.GetApplicationId()];

            while (app.GetState() != RMAppState.Accepted)
            {
                Sharpen.Thread.Sleep(100);
            }
            ClientRMService clientRMService = resourceManager.GetClientRMService();

            try
            {
                // FIFO scheduler does not support moves
                clientRMService.MoveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest.NewInstance
                                                                (application.GetApplicationId(), "newqueue"));
                NUnit.Framework.Assert.Fail("Should have hit exception");
            }
            catch (YarnException ex)
            {
                NUnit.Framework.Assert.AreEqual("Move not supported", ex.InnerException.Message);
            }
        }
Esempio n. 2
0
        /// <exception cref="System.Exception"/>
        public virtual void TestMoveTooLate()
        {
            // Submit application
            Application   application = new Application("user1", resourceManager);
            ApplicationId appId       = application.GetApplicationId();

            application.Submit();
            ClientRMService clientRMService = resourceManager.GetClientRMService();

            // Kill the application
            clientRMService.ForceKillApplication(KillApplicationRequest.NewInstance(appId));
            RMApp rmApp = resourceManager.GetRMContext().GetRMApps()[appId];

            // wait until it's dead
            while (rmApp.GetState() != RMAppState.Killed)
            {
                Sharpen.Thread.Sleep(100);
            }
            try
            {
                clientRMService.MoveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest.NewInstance
                                                                (appId, "newqueue"));
                NUnit.Framework.Assert.Fail("Should have hit exception");
            }
            catch (YarnException ex)
            {
                NUnit.Framework.Assert.AreEqual(typeof(YarnException), ex.GetType());
                NUnit.Framework.Assert.AreEqual("App in KILLED state cannot be moved.", ex.Message
                                                );
            }
        }
Esempio n. 3
0
        /// <exception cref="System.Exception"/>
        public virtual void TestMoveSuccessful()
        {
            MockRM rm1 = new MockRM(conf);

            rm1.Start();
            RMApp           app             = rm1.SubmitApp(1024);
            ClientRMService clientRMService = rm1.GetClientRMService();

            // FIFO scheduler does not support moves
            clientRMService.MoveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest.NewInstance
                                                            (app.GetApplicationId(), "newqueue"));
            RMApp rmApp = rm1.GetRMContext().GetRMApps()[app.GetApplicationId()];

            NUnit.Framework.Assert.AreEqual("newqueue", rmApp.GetQueue());
            rm1.Stop();
        }