Example #1
0
        public virtual void TestRefreshQueues()
        {
            RefreshQueuesRequest request = recordFactory.NewRecordInstance <RefreshQueuesRequest
                                                                            >();
            RefreshQueuesResponse response = client.RefreshQueues(request);

            NUnit.Framework.Assert.IsNotNull(response);
        }
Example #2
0
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
        private int RefreshQueues()
        {
            // Refresh the queue properties
            ResourceManagerAdministrationProtocol adminProtocol = CreateAdminProtocol();
            RefreshQueuesRequest request = recordFactory.NewRecordInstance <RefreshQueuesRequest
                                                                            >();

            adminProtocol.RefreshQueues(request);
            return(0);
        }
        RefreshQueues(RpcController controller, YarnServerResourceManagerServiceProtos.RefreshQueuesRequestProto
                      proto)
        {
            RefreshQueuesRequestPBImpl request = new RefreshQueuesRequestPBImpl(proto);

            try
            {
                RefreshQueuesResponse response = real.RefreshQueues(request);
                return(((RefreshQueuesResponsePBImpl)response).GetProto());
            }
            catch (YarnException e)
            {
                throw new ServiceException(e);
            }
            catch (IOException e)
            {
                throw new ServiceException(e);
            }
        }
Example #4
0
        /// <exception cref="System.Exception"/>
        public virtual void TestException()
        {
            TextWriter            oldErrPrintStream = System.Console.Error;
            ByteArrayOutputStream dataErr           = new ByteArrayOutputStream();

            Runtime.SetErr(new TextWriter(dataErr));
            try
            {
                Org.Mockito.Mockito.When(admin.RefreshQueues(Matchers.Any <RefreshQueuesRequest>()
                                                             )).ThenThrow(new IOException("test exception"));
                string[] args = new string[] { "-refreshQueues" };
                NUnit.Framework.Assert.AreEqual(-1, rmAdminCLI.Run(args));
                Org.Mockito.Mockito.Verify(admin).RefreshQueues(Matchers.Any <RefreshQueuesRequest
                                                                              >());
                NUnit.Framework.Assert.IsTrue(dataErr.ToString().Contains("refreshQueues: test exception"
                                                                          ));
            }
            finally
            {
                Runtime.SetErr(oldErrPrintStream);
            }
        }