use of co.cask.cdap.messaging.MessagingService in project cdap by caskdata.
the class DefaultPreviewRunner method startUp.
@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(), systemArtifactLoader.start(), programRuntimeService.start(), programLifecycleService.start(), metricsCollectionService.start(), programNotificationSubscriberService.start()).get();
}
use of co.cask.cdap.messaging.MessagingService in project cdap by caskdata.
the class RuntimeMonitorTest method init.
@Before
public void init() throws IOException, UnsupportedTypeException {
cConf = CConfiguration.create();
cConf.set(Constants.AppFabric.OUTPUT_DIR, System.getProperty("java.io.tmpdir"));
cConf.set(Constants.AppFabric.TEMP_DIR, System.getProperty("java.io.tmpdir"));
cConf.set(Constants.AppFabric.PROGRAM_STATUS_EVENT_TOPIC, "cdap-status");
cConf.set(Constants.RuntimeMonitor.BATCH_LIMIT, "2");
cConf.set(Constants.RuntimeMonitor.POLL_TIME_MS, "20");
cConf.set(Constants.RuntimeMonitor.TOPICS, Constants.AppFabric.PROGRAM_STATUS_RECORD_EVENT_TOPIC);
injector = Guice.createInjector(new AppFabricTestModule(cConf));
messagingService = injector.getInstance(MessagingService.class);
if (messagingService instanceof Service) {
((Service) messagingService).startAndWait();
}
address = new InetSocketAddress(InetAddress.getLoopbackAddress(), 1234);
httpServer = HttpServer.create(address, 0);
httpServer.start();
}
use of co.cask.cdap.messaging.MessagingService in project cdap by caskdata.
the class AuditPublishTest method init.
@BeforeClass
public static void init() throws Exception {
cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
Injector injector = AppFabricTestHelper.getInjector(cConf, new AuditModule().getDistributedModules());
messagingService = injector.getInstance(MessagingService.class);
if (messagingService instanceof Service) {
((Service) messagingService).startAndWait();
}
auditTopic = NamespaceId.SYSTEM.topic(cConf.get(Constants.Audit.TOPIC));
}
Aggregations