Пример #1
0
 public void run() throws Exception {
   coord.start(10000);
   DrillbitEndpoint md = engine.start();
   cache.run();
   manager.start(md, cache, engine.getBitCom(), coord);
   handle = coord.register(md);
 }
Пример #2
0
 public Drillbit(DrillConfig config, RemoteServiceSet serviceSet) throws Exception {
   if (serviceSet != null) {
     this.context = new BootStrapContext(config);
     this.manager = new WorkManager(context);
     this.coord = serviceSet.getCoordinator();
     this.engine = new ServiceEngine(manager.getBitComWorker(), manager.getUserWorker(), context);
     this.cache = serviceSet.getCache();
   } else {
     Runtime.getRuntime().addShutdownHook(new ShutdownThread(config));
     this.context = new BootStrapContext(config);
     this.manager = new WorkManager(context);
     this.coord = new ZKClusterCoordinator(config);
     this.engine = new ServiceEngine(manager.getBitComWorker(), manager.getUserWorker(), context);
     this.cache = new HazelCache(config);
   }
 }