use of io.cdap.cdap.common.service.HealthCheckService in project cdap by caskdata.
the class AppFabricServiceMain method addServices.
@Override
protected void addServices(Injector injector, List<? super Service> services, List<? super AutoCloseable> closeableResources, MasterEnvironment masterEnv, MasterEnvironmentContext masterEnvContext, EnvironmentOptions options) {
CConfiguration cConf = injector.getInstance(CConfiguration.class);
if (SecurityUtil.isInternalAuthEnabled(cConf)) {
services.add(injector.getInstance(TokenManager.class));
}
closeableResources.add(injector.getInstance(AccessControllerInstantiator.class));
services.add(injector.getInstance(OperationalStatsService.class));
services.add(injector.getInstance(SecureStoreService.class));
services.add(injector.getInstance(DatasetOpExecutorService.class));
services.add(injector.getInstance(ServiceStore.class));
HealthCheckService healthCheckService = injector.getInstance(HealthCheckService.class);
healthCheckService.helper(Constants.AppFabricHealthCheck.APP_FABRIC_HEALTH_CHECK_SERVICE, cConf, Constants.Service.MASTER_SERVICES_BIND_ADDRESS);
services.add(healthCheckService);
Binding<ZKClientService> zkBinding = injector.getExistingBinding(Key.get(ZKClientService.class));
if (zkBinding != null) {
services.add(zkBinding.getProvider().get());
}
// Start both the remote TwillRunnerService and regular TwillRunnerService
TwillRunnerService remoteTwillRunner = injector.getInstance(Key.get(TwillRunnerService.class, Constants.AppFabric.RemoteExecution.class));
services.add(new TwillRunnerServiceWrapper(remoteTwillRunner));
services.add(new TwillRunnerServiceWrapper(injector.getInstance(TwillRunnerService.class)));
services.add(new RetryOnStartFailureService(() -> injector.getInstance(DatasetService.class), RetryStrategies.exponentialDelay(200, 5000, TimeUnit.MILLISECONDS)));
services.add(injector.getInstance(AppFabricServer.class));
services.add(injector.getInstance(TetheringClientSubscriberService.class));
if (cConf.getBoolean(Constants.TaskWorker.POOL_ENABLE)) {
services.add(injector.getInstance(TaskWorkerServiceLauncher.class));
}
if (cConf.getBoolean(SystemWorker.POOL_ENABLE)) {
services.add(injector.getInstance(SystemWorkerServiceLauncher.class));
}
// Optionally adds the master environment task
masterEnv.getTask().ifPresent(task -> services.add(new MasterTaskExecutorService(task, masterEnvContext)));
}
Aggregations