Search in sources :

Example 1 with HealthCheckService

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)));
}
Also used : TetheringClientSubscriberService(io.cdap.cdap.internal.tethering.TetheringClientSubscriberService) HealthCheckService(io.cdap.cdap.common.service.HealthCheckService) AppFabricServer(io.cdap.cdap.internal.app.services.AppFabricServer) AccessControllerInstantiator(io.cdap.cdap.security.authorization.AccessControllerInstantiator) Constants(io.cdap.cdap.common.conf.Constants) CConfiguration(io.cdap.cdap.common.conf.CConfiguration) TaskWorkerServiceLauncher(io.cdap.cdap.internal.app.worker.TaskWorkerServiceLauncher) OperationalStatsService(io.cdap.cdap.operations.OperationalStatsService) ServiceStore(io.cdap.cdap.app.store.ServiceStore) ZKClientService(org.apache.twill.zookeeper.ZKClientService) DatasetOpExecutorService(io.cdap.cdap.data2.datafabric.dataset.service.executor.DatasetOpExecutorService) TwillRunnerService(org.apache.twill.api.TwillRunnerService) SystemWorkerServiceLauncher(io.cdap.cdap.internal.app.worker.system.SystemWorkerServiceLauncher) RetryOnStartFailureService(io.cdap.cdap.common.service.RetryOnStartFailureService) TokenManager(io.cdap.cdap.security.auth.TokenManager) SecureStoreService(io.cdap.cdap.security.store.SecureStoreService)

Aggregations

ServiceStore (io.cdap.cdap.app.store.ServiceStore)1 CConfiguration (io.cdap.cdap.common.conf.CConfiguration)1 Constants (io.cdap.cdap.common.conf.Constants)1 HealthCheckService (io.cdap.cdap.common.service.HealthCheckService)1 RetryOnStartFailureService (io.cdap.cdap.common.service.RetryOnStartFailureService)1 DatasetOpExecutorService (io.cdap.cdap.data2.datafabric.dataset.service.executor.DatasetOpExecutorService)1 AppFabricServer (io.cdap.cdap.internal.app.services.AppFabricServer)1 TaskWorkerServiceLauncher (io.cdap.cdap.internal.app.worker.TaskWorkerServiceLauncher)1 SystemWorkerServiceLauncher (io.cdap.cdap.internal.app.worker.system.SystemWorkerServiceLauncher)1 TetheringClientSubscriberService (io.cdap.cdap.internal.tethering.TetheringClientSubscriberService)1 OperationalStatsService (io.cdap.cdap.operations.OperationalStatsService)1 TokenManager (io.cdap.cdap.security.auth.TokenManager)1 AccessControllerInstantiator (io.cdap.cdap.security.authorization.AccessControllerInstantiator)1 SecureStoreService (io.cdap.cdap.security.store.SecureStoreService)1 TwillRunnerService (org.apache.twill.api.TwillRunnerService)1 ZKClientService (org.apache.twill.zookeeper.ZKClientService)1