Search in sources :

Example 1 with NoopEmitter

use of org.apache.druid.java.util.emitter.core.NoopEmitter in project druid by druid-io.

the class MySQLMetadataStorageModuleTest method createInjector.

private Injector createInjector() {
    MySQLMetadataStorageModule module = new MySQLMetadataStorageModule();
    Injector injector = GuiceInjectors.makeStartupInjectorWithModules(ImmutableList.of(new MetadataConfigModule(), new LifecycleModule(), module, new Module() {

        @Override
        public void configure(Binder binder) {
            module.createBindingChoices(binder, "mysql");
        }

        @Provides
        public ServiceEmitter getEmitter() {
            return new ServiceEmitter("test", "localhost", new NoopEmitter());
        }
    }));
    ObjectMapper mapper = injector.getInstance(Key.get(ObjectMapper.class, Json.class));
    mapper.registerModules(module.getJacksonModules());
    return injector;
}
Also used : ServiceEmitter(org.apache.druid.java.util.emitter.service.ServiceEmitter) Binder(com.google.inject.Binder) MetadataConfigModule(org.apache.druid.guice.MetadataConfigModule) Injector(com.google.inject.Injector) Json(org.apache.druid.guice.annotations.Json) Module(com.google.inject.Module) LifecycleModule(org.apache.druid.guice.LifecycleModule) MetadataConfigModule(org.apache.druid.guice.MetadataConfigModule) NoopEmitter(org.apache.druid.java.util.emitter.core.NoopEmitter) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) LifecycleModule(org.apache.druid.guice.LifecycleModule)

Example 2 with NoopEmitter

use of org.apache.druid.java.util.emitter.core.NoopEmitter in project druid by druid-io.

the class NoopEmitterFactory method makeEmitter.

public Emitter makeEmitter(Lifecycle lifecycle) {
    Emitter retVal = new NoopEmitter();
    lifecycle.addManagedInstance(retVal);
    return retVal;
}
Also used : Emitter(org.apache.druid.java.util.emitter.core.Emitter) NoopEmitter(org.apache.druid.java.util.emitter.core.NoopEmitter) NoopEmitter(org.apache.druid.java.util.emitter.core.NoopEmitter)

Example 3 with NoopEmitter

use of org.apache.druid.java.util.emitter.core.NoopEmitter in project druid by druid-io.

the class KinesisIndexTaskTest method setupClass.

@BeforeClass
public static void setupClass() {
    emitter = new ServiceEmitter("service", "host", new NoopEmitter());
    emitter.start();
    EmittingLogger.registerEmitter(emitter);
    taskExec = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool(Execs.makeThreadFactory("kinesis-task-test-%d")));
}
Also used : ServiceEmitter(org.apache.druid.java.util.emitter.service.ServiceEmitter) NoopEmitter(org.apache.druid.java.util.emitter.core.NoopEmitter) BeforeClass(org.junit.BeforeClass)

Example 4 with NoopEmitter

use of org.apache.druid.java.util.emitter.core.NoopEmitter in project druid by druid-io.

the class KafkaIndexTaskTest method setupClass.

@BeforeClass
public static void setupClass() throws Exception {
    emitter = new ServiceEmitter("service", "host", new NoopEmitter());
    emitter.start();
    EmittingLogger.registerEmitter(emitter);
    zkServer = new TestingCluster(1);
    zkServer.start();
    kafkaServer = new TestBroker(zkServer.getConnectString(), null, 1, ImmutableMap.of("num.partitions", "2"));
    kafkaServer.start();
    taskExec = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool(Execs.makeThreadFactory("kafka-task-test-%d")));
}
Also used : ServiceEmitter(org.apache.druid.java.util.emitter.service.ServiceEmitter) TestingCluster(org.apache.curator.test.TestingCluster) TestBroker(org.apache.druid.indexing.kafka.test.TestBroker) NoopEmitter(org.apache.druid.java.util.emitter.core.NoopEmitter) BeforeClass(org.junit.BeforeClass)

Aggregations

NoopEmitter (org.apache.druid.java.util.emitter.core.NoopEmitter)4 ServiceEmitter (org.apache.druid.java.util.emitter.service.ServiceEmitter)3 BeforeClass (org.junit.BeforeClass)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Binder (com.google.inject.Binder)1 Injector (com.google.inject.Injector)1 Module (com.google.inject.Module)1 TestingCluster (org.apache.curator.test.TestingCluster)1 LifecycleModule (org.apache.druid.guice.LifecycleModule)1 MetadataConfigModule (org.apache.druid.guice.MetadataConfigModule)1 Json (org.apache.druid.guice.annotations.Json)1 TestBroker (org.apache.druid.indexing.kafka.test.TestBroker)1 Emitter (org.apache.druid.java.util.emitter.core.Emitter)1