예제 #1
0
 public virtual void CleanUp()
 {
     if (store != null)
     {
         store.Stop();
         store = null;
     }
     if (service != null)
     {
         service.Stop();
         service = null;
     }
     if (clientSCMProxy != null)
     {
         RPC.StopProxy(clientSCMProxy);
         clientSCMProxy = null;
     }
 }
예제 #2
0
        public virtual void StartUp()
        {
            Configuration conf = new Configuration();

            conf.Set(YarnConfiguration.ScmStoreClass, typeof(InMemorySCMStore).FullName);
            conf.Set(YarnConfiguration.SharedCacheRoot, testDir.GetPath());
            AppChecker appChecker = Org.Mockito.Mockito.Spy(new DummyAppChecker());

            store = new InMemorySCMStore(appChecker);
            store.Init(conf);
            store.Start();
            service = new ClientProtocolService(store);
            service.Init(conf);
            service.Start();
            YarnRPC    rpc        = YarnRPC.Create(new Configuration());
            IPEndPoint scmAddress = conf.GetSocketAddr(YarnConfiguration.ScmClientServerAddress
                                                       , YarnConfiguration.DefaultScmClientServerAddress, YarnConfiguration.DefaultScmClientServerPort
                                                       );

            clientSCMProxy = (ClientSCMProtocol)rpc.GetProxy(typeof(ClientSCMProtocol), scmAddress
                                                             , conf);
        }
예제 #3
0
        /// <exception cref="System.Exception"/>
        protected override void ServiceInit(Configuration conf)
        {
            this.store = CreateSCMStoreService(conf);
            AddService(store);
            CleanerService cs = CreateCleanerService(store);

            AddService(cs);
            SharedCacheUploaderService nms = CreateNMCacheUploaderSCMProtocolService(store);

            AddService(nms);
            ClientProtocolService cps = CreateClientProtocolService(store);

            AddService(cps);
            SCMAdminProtocolService saps = CreateSCMAdminProtocolService(cs);

            AddService(saps);
            SCMWebServer webUI = CreateSCMWebServer(this);

            AddService(webUI);
            // init metrics
            DefaultMetricsSystem.Initialize("SharedCacheManager");
            JvmMetrics.InitSingleton("SharedCacheManager", null);
            base.ServiceInit(conf);
        }