コード例 #1
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
                                                );
            }
        }
コード例 #2
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);
            }
        }
コード例 #3
0
ファイル: YarnClientImpl.cs プロジェクト: orf53975/hadoop.net
        /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
        /// <exception cref="System.IO.IOException"/>
        public override void MoveApplicationAcrossQueues(ApplicationId appId, string queue
                                                         )
        {
            MoveApplicationAcrossQueuesRequest request = MoveApplicationAcrossQueuesRequest.NewInstance
                                                             (appId, queue);

            rmClient.MoveApplicationAcrossQueues(request);
        }
コード例 #4
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();
        }
コード例 #5
0
 /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
 /// <exception cref="System.IO.IOException"/>
 public virtual MoveApplicationAcrossQueuesResponse MoveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest
                                                                                request)
 {
     YarnServiceProtos.MoveApplicationAcrossQueuesRequestProto requestProto = ((MoveApplicationAcrossQueuesRequestPBImpl
                                                                                )request).GetProto();
     try
     {
         return(new MoveApplicationAcrossQueuesResponsePBImpl(proxy.MoveApplicationAcrossQueues
                                                                  (null, requestProto)));
     }
     catch (ServiceException e)
     {
         RPCUtil.UnwrapAndThrowException(e);
         return(null);
     }
 }
コード例 #6
0
 /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
 public override MoveApplicationAcrossQueuesResponse MoveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest
                                                                                 request)
 {
     this._enclosing.ResetStartFailoverFlag(true);
     // make sure failover has been triggered
     NUnit.Framework.Assert.IsTrue(this._enclosing.WaittingForFailOver());
     return(Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <MoveApplicationAcrossQueuesResponse
                                                           >());
 }
コード例 #7
0
 /// <exception cref="System.Exception"/>
 public MoveApplicationAcrossQueuesResponse Run()
 {
     return(clientRMService.MoveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest
                                                        .NewInstance(application.GetApplicationId(), "newqueue")));
 }
コード例 #8
0
 /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
 /// <exception cref="System.IO.IOException"/>
 public virtual MoveApplicationAcrossQueuesResponse MoveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest
                                                                                request)
 {
     return(null);
 }