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); }
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); } }