Search in sources :

Example 1 with TestBroker

use of io.druid.indexing.kafka.test.TestBroker in project druid by druid-io.

the class KafkaSupervisorTest method setUp.

@Before
public void setUp() throws Exception {
    taskStorage = createMock(TaskStorage.class);
    taskMaster = createMock(TaskMaster.class);
    taskRunner = createMock(TaskRunner.class);
    indexerMetadataStorageCoordinator = createMock(IndexerMetadataStorageCoordinator.class);
    taskClient = createMock(KafkaIndexTaskClient.class);
    taskQueue = createMock(TaskQueue.class);
    zkServer = new TestingCluster(1);
    zkServer.start();
    kafkaServer = new TestBroker(zkServer.getConnectString(), tempFolder.newFolder(), 1, ImmutableMap.of("num.partitions", String.valueOf(NUM_PARTITIONS)));
    kafkaServer.start();
    kafkaHost = String.format("localhost:%d", kafkaServer.getPort());
    dataSchema = getDataSchema(DATASOURCE);
    tuningConfig = new KafkaSupervisorTuningConfig(1000, 50000, new Period("P1Y"), new File("/test"), null, null, true, false, null, null, numThreads, TEST_CHAT_THREADS, TEST_CHAT_RETRIES, TEST_HTTP_TIMEOUT, TEST_SHUTDOWN_TIMEOUT);
}
Also used : IndexerMetadataStorageCoordinator(io.druid.indexing.overlord.IndexerMetadataStorageCoordinator) TestingCluster(org.apache.curator.test.TestingCluster) TaskStorage(io.druid.indexing.overlord.TaskStorage) TestBroker(io.druid.indexing.kafka.test.TestBroker) KafkaIndexTaskClient(io.druid.indexing.kafka.KafkaIndexTaskClient) TaskQueue(io.druid.indexing.overlord.TaskQueue) Period(org.joda.time.Period) TaskMaster(io.druid.indexing.overlord.TaskMaster) File(java.io.File) TaskRunner(io.druid.indexing.overlord.TaskRunner) Before(org.junit.Before)

Example 2 with TestBroker

use of io.druid.indexing.kafka.test.TestBroker 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

TestBroker (io.druid.indexing.kafka.test.TestBroker)2 TestingCluster (org.apache.curator.test.TestingCluster)2 Before (org.junit.Before)2 LoggingEmitter (com.metamx.emitter.core.LoggingEmitter)1 ServiceEmitter (com.metamx.emitter.service.ServiceEmitter)1 KafkaIndexTaskClient (io.druid.indexing.kafka.KafkaIndexTaskClient)1 IndexerMetadataStorageCoordinator (io.druid.indexing.overlord.IndexerMetadataStorageCoordinator)1 TaskMaster (io.druid.indexing.overlord.TaskMaster)1 TaskQueue (io.druid.indexing.overlord.TaskQueue)1 TaskRunner (io.druid.indexing.overlord.TaskRunner)1 TaskStorage (io.druid.indexing.overlord.TaskStorage)1 DefaultObjectMapper (io.druid.jackson.DefaultObjectMapper)1 File (java.io.File)1 Period (org.joda.time.Period)1