Search in sources :

Example 11 with TestIndexerMetadataStorageCoordinator

use of org.apache.druid.indexing.test.TestIndexerMetadataStorageCoordinator in project druid by druid-io.

the class TaskLockConfigTest method createTaskQueue.

private TaskQueue createTaskQueue(@Nullable Boolean forceTimeChunkLock) {
    final TaskLockConfig lockConfig;
    if (forceTimeChunkLock != null) {
        lockConfig = new TaskLockConfig() {

            @Override
            public boolean isForceTimeChunkLock() {
                return forceTimeChunkLock;
            }
        };
    } else {
        lockConfig = new TaskLockConfig();
    }
    final TaskQueueConfig queueConfig = new TaskQueueConfig(null, null, null, null);
    final TaskRunner taskRunner = EasyMock.createNiceMock(RemoteTaskRunner.class);
    final TaskActionClientFactory actionClientFactory = EasyMock.createNiceMock(LocalTaskActionClientFactory.class);
    final TaskLockbox lockbox = new TaskLockbox(taskStorage, new TestIndexerMetadataStorageCoordinator());
    final ServiceEmitter emitter = new NoopServiceEmitter();
    return new TaskQueue(lockConfig, queueConfig, new DefaultTaskConfig(), taskStorage, taskRunner, actionClientFactory, lockbox, emitter);
}
Also used : ServiceEmitter(org.apache.druid.java.util.emitter.service.ServiceEmitter) NoopServiceEmitter(org.apache.druid.server.metrics.NoopServiceEmitter) TestIndexerMetadataStorageCoordinator(org.apache.druid.indexing.test.TestIndexerMetadataStorageCoordinator) LocalTaskActionClientFactory(org.apache.druid.indexing.common.actions.LocalTaskActionClientFactory) TaskActionClientFactory(org.apache.druid.indexing.common.actions.TaskActionClientFactory) TaskQueueConfig(org.apache.druid.indexing.overlord.config.TaskQueueConfig) NoopServiceEmitter(org.apache.druid.server.metrics.NoopServiceEmitter) DefaultTaskConfig(org.apache.druid.indexing.overlord.config.DefaultTaskConfig) TaskLockConfig(org.apache.druid.indexing.overlord.config.TaskLockConfig)

Aggregations

TestIndexerMetadataStorageCoordinator (org.apache.druid.indexing.test.TestIndexerMetadataStorageCoordinator)11 TaskStatus (org.apache.druid.indexer.TaskStatus)9 TaskToolbox (org.apache.druid.indexing.common.TaskToolbox)9 InitializedNullHandlingTest (org.apache.druid.testing.InitializedNullHandlingTest)9 Test (org.junit.Test)9 TestFirehose (org.apache.druid.indexing.common.TestFirehose)8 Executor (java.util.concurrent.Executor)5 Pair (org.apache.druid.java.util.common.Pair)5 SegmentDescriptor (org.apache.druid.query.SegmentDescriptor)5 DataSegment (org.apache.druid.timeline.DataSegment)5 File (java.io.File)4 ImmutableMap (com.google.common.collect.ImmutableMap)3 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)3 Map (java.util.Map)3 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)3 Period (org.joda.time.Period)3 HashSet (java.util.HashSet)2 TaskStorageConfig (org.apache.druid.indexing.common.config.TaskStorageConfig)2 HeapMemoryTaskStorage (org.apache.druid.indexing.overlord.HeapMemoryTaskStorage)2 ParseException (org.apache.druid.java.util.common.parsers.ParseException)2