Пример #1
0
        public virtual void TestApplications()
        {
            ApplicationId appId = null;

            appId = ApplicationId.NewInstance(0, 1);
            ApplicationId             appId1    = ApplicationId.NewInstance(0, 2);
            GetApplicationsRequest    request   = GetApplicationsRequest.NewInstance();
            GetApplicationsResponse   response  = clientService.GetApplications(request);
            IList <ApplicationReport> appReport = response.GetApplicationList();

            NUnit.Framework.Assert.IsNotNull(appReport);
            NUnit.Framework.Assert.AreEqual(appId, appReport[1].GetApplicationId());
            NUnit.Framework.Assert.AreEqual(appId1, appReport[0].GetApplicationId());
            // Create a historyManager, and set the max_apps can be loaded
            // as 1.
            Configuration conf = new YarnConfiguration();

            conf.SetLong(YarnConfiguration.ApplicationHistoryMaxApps, 1);
            ApplicationHistoryManagerOnTimelineStore historyManager2 = new ApplicationHistoryManagerOnTimelineStore
                                                                           (dataManager, new ApplicationACLsManager(conf));

            historyManager2.Init(conf);
            historyManager2.Start();
            ApplicationHistoryClientService clientService2 = new ApplicationHistoryClientService
                                                                 (historyManager2);

            response  = clientService2.GetApplications(request);
            appReport = response.GetApplicationList();
            NUnit.Framework.Assert.IsNotNull(appReport);
            NUnit.Framework.Assert.IsTrue(appReport.Count == 1);
            // Expected to get the appReport for application with appId1
            NUnit.Framework.Assert.AreEqual(appId1, appReport[0].GetApplicationId());
        }
Пример #2
0
        public virtual void Setup()
        {
            // Only test the ACLs of the generic history
            TimelineACLsManager aclsManager = new TimelineACLsManager(new YarnConfiguration()
                                                                      );
            TimelineDataManager    dataManager    = new TimelineDataManager(store, aclsManager);
            ApplicationACLsManager appAclsManager = new ApplicationACLsManager(conf);

            historyManager = new ApplicationHistoryManagerOnTimelineStore(dataManager, appAclsManager
                                                                          );
            historyManager.Init(conf);
            historyManager.Start();
        }
Пример #3
0
        public static void Setup()
        {
            Configuration conf  = new YarnConfiguration();
            TimelineStore store = TestApplicationHistoryManagerOnTimelineStore.CreateStore(MaxApps
                                                                                           );
            TimelineACLsManager aclsManager = new TimelineACLsManager(conf);

            dataManager = new TimelineDataManager(store, aclsManager);
            ApplicationACLsManager appAclsManager = new ApplicationACLsManager(conf);
            ApplicationHistoryManagerOnTimelineStore historyManager = new ApplicationHistoryManagerOnTimelineStore
                                                                          (dataManager, appAclsManager);

            historyManager.Init(conf);
            historyManager.Start();
            clientService = new ApplicationHistoryClientService(historyManager);
        }