Search in sources :

Example 1 with LoggingEmitter

use of com.metamx.emitter.core.LoggingEmitter in project druid by druid-io.

the class LookupCoordinatorManagerTest method setUpStatic.

@BeforeClass
public static void setUpStatic() {
    LoggingEmitter loggingEmitter = EasyMock.createNiceMock(LoggingEmitter.class);
    EasyMock.replay(loggingEmitter);
    SERVICE_EMITTER = new ServiceEmitter("", "", loggingEmitter) {

        @Override
        public void emit(Event event) {
            EVENT_EMITS.incrementAndGet();
            super.emit(event);
        }
    };
    com.metamx.emitter.EmittingLogger.registerEmitter(SERVICE_EMITTER);
}
Also used : ServiceEmitter(com.metamx.emitter.service.ServiceEmitter) Event(com.metamx.emitter.core.Event) LoggingEmitter(com.metamx.emitter.core.LoggingEmitter) BeforeClass(org.junit.BeforeClass)

Example 2 with LoggingEmitter

use of com.metamx.emitter.core.LoggingEmitter in project druid by druid-io.

the class KafkaIndexTaskTest method setUp.

@Before
public void setUp() throws Exception {
    emitter = new ServiceEmitter("service", "host", new LoggingEmitter(log, LoggingEmitter.Level.ERROR, new DefaultObjectMapper()));
    emitter.start();
    EmittingLogger.registerEmitter(emitter);
    makeToolboxFactory();
    zkServer = new TestingCluster(1);
    zkServer.start();
    kafkaServer = new TestBroker(zkServer.getConnectString(), tempFolder.newFolder(), 1, ImmutableMap.of("num.partitions", "2"));
    kafkaServer.start();
    taskExec = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool(Execs.makeThreadFactory("kafka-task-test-%d")));
    handoffConditionTimeout = 0;
    reportParseExceptions = false;
    doHandoff = true;
}
Also used : ServiceEmitter(com.metamx.emitter.service.ServiceEmitter) TestingCluster(org.apache.curator.test.TestingCluster) TestBroker(io.druid.indexing.kafka.test.TestBroker) DefaultObjectMapper(io.druid.jackson.DefaultObjectMapper) LoggingEmitter(com.metamx.emitter.core.LoggingEmitter) Before(org.junit.Before)

Aggregations

LoggingEmitter (com.metamx.emitter.core.LoggingEmitter)2 ServiceEmitter (com.metamx.emitter.service.ServiceEmitter)2 Event (com.metamx.emitter.core.Event)1 TestBroker (io.druid.indexing.kafka.test.TestBroker)1 DefaultObjectMapper (io.druid.jackson.DefaultObjectMapper)1 TestingCluster (org.apache.curator.test.TestingCluster)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1