示例#1
0
        public virtual void SetUp()
        {
            Configuration conf = new Configuration();

            // Dispatcher that processes events inline
            dispatcher = new InlineDispatcher();
            dispatcher.Register(typeof(RMNodeEventType), new TestNMReconnect.TestRMNodeEventDispatcher
                                    (this));
            context = new RMContextImpl(dispatcher, null, null, null, null, null, null, null,
                                        null, null);
            dispatcher.Register(typeof(SchedulerEventType), new InlineDispatcher.EmptyEventHandler
                                    ());
            dispatcher.Register(typeof(RMNodeEventType), new ResourceManager.NodeEventDispatcher
                                    (context));
            NMLivelinessMonitor nmLivelinessMonitor = new NMLivelinessMonitor(dispatcher);

            nmLivelinessMonitor.Init(conf);
            nmLivelinessMonitor.Start();
            NodesListManager nodesListManager = new NodesListManager(context);

            nodesListManager.Init(conf);
            RMContainerTokenSecretManager containerTokenSecretManager = new RMContainerTokenSecretManager
                                                                            (conf);

            containerTokenSecretManager.Start();
            NMTokenSecretManagerInRM nmTokenSecretManager = new NMTokenSecretManagerInRM(conf
                                                                                         );

            nmTokenSecretManager.Start();
            resourceTrackerService = new ResourceTrackerService(context, nodesListManager, nmLivelinessMonitor
                                                                , containerTokenSecretManager, nmTokenSecretManager);
            resourceTrackerService.Init(conf);
            resourceTrackerService.Start();
        }
        public virtual void SetUp()
        {
            Configuration conf = new Configuration();
            // Dispatcher that processes events inline
            Dispatcher dispatcher = new InlineDispatcher();

            dispatcher.Register(typeof(SchedulerEventType), new _EventHandler_65());
            // ignore
            RMContext context = new RMContextImpl(dispatcher, null, null, null, null, null, new
                                                  RMContainerTokenSecretManager(conf), new NMTokenSecretManagerInRM(conf), null, null
                                                  );

            dispatcher.Register(typeof(RMNodeEventType), new ResourceManager.NodeEventDispatcher
                                    (context));
            NodesListManager nodesListManager = new NodesListManager(context);

            nodesListManager.Init(conf);
            context.GetContainerTokenSecretManager().RollMasterKey();
            context.GetNMTokenSecretManager().RollMasterKey();
            resourceTrackerService = new ResourceTrackerService(context, nodesListManager, new
                                                                NMLivelinessMonitor(dispatcher), context.GetContainerTokenSecretManager(), context
                                                                .GetNMTokenSecretManager());
            resourceTrackerService.Init(conf);
        }