use of co.cask.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class RemoteSystemOperationsService method startUp.
@Override
protected void startUp() throws Exception {
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.REMOTE_SYSTEM_OPERATION));
LOG.info("Starting RemoteSystemOperationService...");
httpService.startAndWait();
cancellable = discoveryService.register(ResolvingDiscoverable.of(new Discoverable(Constants.Service.REMOTE_SYSTEM_OPERATION, httpService.getBindAddress())));
LOG.info("RemoteSystemOperationService started successfully on {}", httpService.getBindAddress());
}
use of co.cask.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class DatasetOpExecutorService method startUp.
@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.startAndWait();
cancellable = discoveryService.register(ResolvingDiscoverable.of(new Discoverable(Constants.Service.DATASET_EXECUTOR, httpService.getBindAddress())));
LOG.info("DatasetOpExecutorService started successfully on {}", httpService.getBindAddress());
}
use of co.cask.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class StreamHttpService method startUp.
@Override
protected void startUp() throws Exception {
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getEntityName(), Constants.Logging.COMPONENT_NAME, Constants.Service.STREAMS));
httpService.startAndWait();
discoverable = ResolvingDiscoverable.of(new Discoverable(Constants.Service.STREAMS, httpService.getBindAddress()));
cancellable = discoveryService.register(discoverable);
}
use of co.cask.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class ExploreServiceTwillRunnable method doInit.
@Override
protected Injector doInit(TwillContext context) {
setupHive();
CConfiguration cConf = getCConfiguration();
Configuration hConf = getConfiguration();
addResource(hConf, "yarn-site.xml");
addResource(hConf, "mapred-site.xml");
addResource(hConf, "hive-site.xml");
addResource(hConf, "tez-site.xml");
// Set the host name to the one provided by Twill
cConf.set(Constants.Explore.SERVER_ADDRESS, context.getHost().getHostName());
String txClientId = String.format("cdap.service.%s.%d", Constants.Service.EXPLORE_HTTP_USER_SERVICE, context.getInstanceId());
// NOTE: twill client will try to load all the classes present here - including hive classes but it
// will fail since Hive classes are not in master classpath, and ignore those classes silently
injector = createInjector(cConf, hConf, txClientId);
injector.getInstance(LogAppenderInitializer.class).initialize();
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.EXPLORE_HTTP_USER_SERVICE));
return injector;
}
use of co.cask.cdap.common.logging.ServiceLoggingContext in project cdap by caskdata.
the class MetricsProcessorTwillRunnable method doInit.
@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;
}
Aggregations