Search in sources :

Example 16 with MessagingService

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();
}
Also used : MessagingService(co.cask.cdap.messaging.MessagingService) MetricsCollectionService(co.cask.cdap.api.metrics.MetricsCollectionService) ProgramRuntimeService(co.cask.cdap.app.runtime.ProgramRuntimeService) ProgramNotificationSubscriberService(co.cask.cdap.internal.app.services.ProgramNotificationSubscriberService) ProgramLifecycleService(co.cask.cdap.internal.app.services.ProgramLifecycleService) AbstractIdleService(com.google.common.util.concurrent.AbstractIdleService) ApplicationLifecycleService(co.cask.cdap.internal.app.services.ApplicationLifecycleService) DatasetService(co.cask.cdap.data2.datafabric.dataset.service.DatasetService) Service(com.google.common.util.concurrent.Service) ServiceLoggingContext(co.cask.cdap.common.logging.ServiceLoggingContext)

Example 17 with MessagingService

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();
}
Also used : InetSocketAddress(java.net.InetSocketAddress) MessagingService(co.cask.cdap.messaging.MessagingService) Service(com.google.common.util.concurrent.Service) AppFabricTestModule(co.cask.cdap.internal.guice.AppFabricTestModule) MessagingService(co.cask.cdap.messaging.MessagingService) Before(org.junit.Before)

Example 18 with MessagingService

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));
}
Also used : Injector(com.google.inject.Injector) MessagingService(co.cask.cdap.messaging.MessagingService) Service(com.google.common.util.concurrent.Service) AuditModule(co.cask.cdap.data2.audit.AuditModule) MessagingService(co.cask.cdap.messaging.MessagingService) BeforeClass(org.junit.BeforeClass)

Aggregations

MessagingService (co.cask.cdap.messaging.MessagingService)18 Service (com.google.common.util.concurrent.Service)17 MetricsCollectionService (co.cask.cdap.api.metrics.MetricsCollectionService)14 DatasetService (co.cask.cdap.data2.datafabric.dataset.service.DatasetService)8 MetricsQueryService (co.cask.cdap.metrics.query.MetricsQueryService)6 CConfiguration (co.cask.cdap.common.conf.CConfiguration)5 IOException (java.io.IOException)4 ProgramContextAware (co.cask.cdap.data.ProgramContextAware)3 StreamService (co.cask.cdap.data.stream.service.StreamService)3 DatasetOpExecutor (co.cask.cdap.data2.datafabric.dataset.service.executor.DatasetOpExecutor)3 DatasetFramework (co.cask.cdap.data2.dataset2.DatasetFramework)3 ExploreExecutorService (co.cask.cdap.explore.executor.ExploreExecutorService)3 BasicProgramContext (co.cask.cdap.internal.app.runtime.BasicProgramContext)3 NameMappedDatasetFramework (co.cask.cdap.internal.app.runtime.workflow.NameMappedDatasetFramework)3 WorkflowProgramInfo (co.cask.cdap.internal.app.runtime.workflow.WorkflowProgramInfo)3 ProgramLifecycleService (co.cask.cdap.internal.app.services.ProgramLifecycleService)3 ProgramNotificationSubscriberService (co.cask.cdap.internal.app.services.ProgramNotificationSubscriberService)3 AppFabricTestModule (co.cask.cdap.internal.guice.AppFabricTestModule)3 NotificationService (co.cask.cdap.notifications.service.NotificationService)3 Injector (com.google.inject.Injector)3