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