public static LoggingContext getLoggingContext(String systemId, String componentId, String serviceId) { return new ServiceLoggingContext(systemId, componentId, serviceId); }
public static LoggingContext getLoggingContext(String systemId, String componentId, String serviceId) { return new ServiceLoggingContext(systemId, componentId, serviceId); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS)); LOG.info("Starting Metrics Service..."); httpService.start(); LOG.info("Started Metrics HTTP Service..."); // Register the service cancelDiscovery = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.METRICS, httpService.getBindAddress()))); LOG.info("Metrics Service started successfully on {}", httpService.getBindAddress()); }
@Override protected Injector doInit(TwillContext context) { // Set the hostname of the machine so that cConf can be used to start internal services getCConfiguration().set(Constants.Metrics.ADDRESS, context.getHost().getCanonicalHostName()); LOG.info("{} Setting host name to {}", name, context.getHost().getCanonicalHostName()); String txClientId = String.format("cdap.service.%s.%d", Constants.Service.METRICS, context.getInstanceId()); injector = createGuiceInjector(getCConfiguration(), getConfiguration(), txClientId); injector.getInstance(LogAppenderInitializer.class).initialize(); LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS)); return injector; }
@Override protected Injector doInit(TwillContext context) { getCConfiguration().set(Constants.Transaction.Container.ADDRESS, context.getHost().getCanonicalHostName()); // Set the hostname of the machine so that cConf can be used to start internal services LOG.info("{} Setting host name to {}", name, context.getHost().getCanonicalHostName()); String txClientId = String.format("cdap.service.%s.%d", Constants.Service.TRANSACTION, context.getInstanceId()); injector = createGuiceInjector(getCConfiguration(), getConfiguration(), txClientId); injector.getInstance(LogAppenderInitializer.class).initialize(); LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.TRANSACTION)); return injector; }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS_PROCESSOR)); LOG.info("Starting MetricsProcessor Status Service..."); httpService.start(); cancellable = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.METRICS_PROCESSOR, httpService.getBindAddress()))); LOG.info("Started MetricsProcessor Status Service."); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS_PROCESSOR)); LOG.info("Starting MetricsProcessor Status Service..."); httpService.start(); cancellable = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.METRICS_PROCESSOR, httpService.getBindAddress()))); LOG.info("Started MetricsProcessor Status Service."); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.EXPLORE_HTTP_USER_SERVICE)); LOG.info("Starting {}...", ExploreExecutorService.class.getSimpleName()); if (!startOnDemand) { exploreService.startAndWait(); } httpService.start(); cancellable = discoveryService.register(ResolvingDiscoverable.of( new Discoverable(Constants.Service.EXPLORE_HTTP_USER_SERVICE, httpService.getBindAddress()))); LOG.info("{} started successfully on {}", ExploreExecutorService.class.getSimpleName(), httpService.getBindAddress()); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS)); LOG.info("Starting Metrics Service..."); httpService.start(); LOG.info("Started Metrics HTTP Service..."); // Register the service cancelDiscovery = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.METRICS, httpService.getBindAddress()))); LOG.info("Metrics Service started successfully on {}", httpService.getBindAddress()); }
@Override protected Injector doInit(TwillContext context) { getCConfiguration().set(Constants.MetricsProcessor.ADDRESS, context.getHost().getCanonicalHostName()); // Set the hostname of the machine so that cConf can be used to start internal services LOG.info("{} Setting host name to {}", name, context.getHost().getCanonicalHostName()); String txClientId = String.format("cdap.service.%s.%d", Constants.Service.METRICS_PROCESSOR, context.getInstanceId()); injector = createGuiceInjector(getCConfiguration(), getConfiguration(), txClientId, context); injector.getInstance(LogAppenderInitializer.class).initialize(); LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS_PROCESSOR)); return injector; }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.EXPLORE_HTTP_USER_SERVICE)); LOG.info("Starting {}...", ExploreExecutorService.class.getSimpleName()); if (!startOnDemand) { exploreService.startAndWait(); } httpService.start(); cancellable = discoveryService.register(ResolvingDiscoverable.of( new Discoverable(Constants.Service.EXPLORE_HTTP_USER_SERVICE, httpService.getBindAddress()))); LOG.info("{} started successfully on {}", ExploreExecutorService.class.getSimpleName(), httpService.getBindAddress()); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getEntityName(), Constants.Logging.COMPONENT_NAME, Constants.Service.DATASET_EXECUTOR)); LOG.info("Starting DatasetOpExecutorService..."); httpService.start(); cancellable = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.DATASET_EXECUTOR, httpService.getBindAddress()))); LOG.info("DatasetOpExecutorService started successfully on {}", httpService.getBindAddress()); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getEntityName(), Constants.Logging.COMPONENT_NAME, Constants.Service.DATASET_EXECUTOR)); LOG.info("Starting DatasetOpExecutorService..."); httpService.start(); cancellable = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.DATASET_EXECUTOR, httpService.getBindAddress()))); LOG.info("DatasetOpExecutorService started successfully on {}", httpService.getBindAddress()); }
@Override protected Injector doInit(TwillContext context) { CConfiguration cConf = getCConfiguration(); Configuration hConf = getConfiguration(); // Set the host name to the one provided by Twill cConf.set(Constants.Dataset.Executor.ADDRESS, context.getHost().getHostName()); String txClientId = String.format("cdap.service.%s.%d", Constants.Service.DATASET_EXECUTOR, context.getInstanceId()); injector = createInjector(cConf, hConf, txClientId); injector.getInstance(LogAppenderInitializer.class).initialize(); LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.DATASET_EXECUTOR)); return injector; }
@Override protected Injector doInit(TwillContext context) { CConfiguration cConf = getCConfiguration(); cConf.set(Constants.MessagingSystem.HTTP_SERVER_BIND_ADDRESS, context.getHost().getHostName()); cConf.setInt(Constants.MessagingSystem.CONTAINER_INSTANCE_ID, context.getInstanceId()); injector = createInjector(cConf, getConfiguration()); injector.getInstance(LogAppenderInitializer.class).initialize(); LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.MESSAGING_SERVICE)); return injector; }
@Override protected void startUp() throws Exception { if (messagingService instanceof Service) { ((Service) messagingService).startAndWait(); } datasetService.startAndWait(); // It is recommended to initialize log appender after datasetService is started, // since log appender instantiates a dataset. logAppenderInitializer.initialize(); LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.PREVIEW_HTTP)); Futures.allAsList( applicationLifecycleService.start(), programRuntimeService.start(), metricsCollectionService.start(), programNotificationSubscriberService.start() ).get(); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getEntityName(), Constants.Logging.COMPONENT_NAME, Constants.Service.STREAMS)); httpService.start(); discoverable = ResolvingDiscoverable.of(new Discoverable(Constants.Service.STREAMS, httpService.getBindAddress())); cancellable = discoveryService.register(discoverable); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.LOG_QUERY)); httpServer.start(); cancellable = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.LOG_QUERY, httpServer.getBindAddress()))); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.LOGSAVER)); httpService.start(); cancellable = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.LOGSAVER, httpService.getBindAddress()))); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.LOGSAVER)); httpService.start(); cancellable = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.LOGSAVER, httpService.getBindAddress()))); }