Exemple #1
0
        /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
        /// <exception cref="System.IO.IOException"/>
        public virtual void TestGetApplications()
        {
            Configuration conf   = new Configuration();
            AHSClient     client = new TestAHSClient.MockAHSClient();

            client.Init(conf);
            client.Start();
            IList <ApplicationReport> expectedReports = ((TestAHSClient.MockAHSClient)client).
                                                        GetReports();
            IList <ApplicationReport> reports = client.GetApplications();

            NUnit.Framework.Assert.AreEqual(reports, expectedReports);
            reports = client.GetApplications();
            NUnit.Framework.Assert.AreEqual(reports.Count, 4);
            client.Stop();
        }
Exemple #2
0
        /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
        /// <exception cref="System.IO.IOException"/>
        public virtual void TestGetApplicationReport()
        {
            Configuration conf   = new Configuration();
            AHSClient     client = new TestAHSClient.MockAHSClient();

            client.Init(conf);
            client.Start();
            IList <ApplicationReport> expectedReports = ((TestAHSClient.MockAHSClient)client).
                                                        GetReports();
            ApplicationId     applicationId = ApplicationId.NewInstance(1234, 5);
            ApplicationReport report        = client.GetApplicationReport(applicationId);

            NUnit.Framework.Assert.AreEqual(report, expectedReports[0]);
            NUnit.Framework.Assert.AreEqual(report.GetApplicationId().ToString(), expectedReports
                                            [0].GetApplicationId().ToString());
            client.Stop();
        }
Exemple #3
0
        /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
        /// <exception cref="System.IO.IOException"/>
        public virtual void TestGetApplicationAttempts()
        {
            Configuration conf   = new Configuration();
            AHSClient     client = new TestAHSClient.MockAHSClient();

            client.Init(conf);
            client.Start();
            ApplicationId applicationId = ApplicationId.NewInstance(1234, 5);
            IList <ApplicationAttemptReport> reports = client.GetApplicationAttempts(applicationId
                                                                                     );

            NUnit.Framework.Assert.IsNotNull(reports);
            NUnit.Framework.Assert.AreEqual(reports[0].GetApplicationAttemptId(), ApplicationAttemptId
                                            .NewInstance(applicationId, 1));
            NUnit.Framework.Assert.AreEqual(reports[1].GetApplicationAttemptId(), ApplicationAttemptId
                                            .NewInstance(applicationId, 2));
            client.Stop();
        }
Exemple #4
0
        /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
        /// <exception cref="System.IO.IOException"/>
        public virtual void TestGetContainerReport()
        {
            Configuration conf   = new Configuration();
            AHSClient     client = new TestAHSClient.MockAHSClient();

            client.Init(conf);
            client.Start();
            IList <ApplicationReport> expectedReports = ((TestAHSClient.MockAHSClient)client).
                                                        GetReports();
            ApplicationId        applicationId = ApplicationId.NewInstance(1234, 5);
            ApplicationAttemptId appAttemptId  = ApplicationAttemptId.NewInstance(applicationId
                                                                                  , 1);
            ContainerId     containerId = ContainerId.NewContainerId(appAttemptId, 1);
            ContainerReport report      = client.GetContainerReport(containerId);

            NUnit.Framework.Assert.IsNotNull(report);
            NUnit.Framework.Assert.AreEqual(report.GetContainerId().ToString(), (ContainerId.
                                                                                 NewContainerId(expectedReports[0].GetCurrentApplicationAttemptId(), 1)).ToString
                                                ());
            client.Stop();
        }