Search in sources :

Example 11 with NoopChatHandlerProvider

use of org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider in project druid by druid-io.

the class SingleTaskBackgroundRunnerTest method setup.

@Before
public void setup() throws IOException {
    final TestUtils utils = new TestUtils();
    final DruidNode node = new DruidNode("testServer", "testHost", false, 1000, null, true, false);
    final TaskConfig taskConfig = new TaskConfig(temporaryFolder.newFile().toString(), null, null, 50000, null, true, null, null, null, false, false, TaskConfig.BATCH_PROCESSING_MODE_DEFAULT.name());
    final ServiceEmitter emitter = new NoopServiceEmitter();
    EmittingLogger.registerEmitter(emitter);
    final TaskToolboxFactory toolboxFactory = new TaskToolboxFactory(taskConfig, null, EasyMock.createMock(TaskActionClientFactory.class), emitter, new NoopDataSegmentPusher(), new NoopDataSegmentKiller(), new NoopDataSegmentMover(), new NoopDataSegmentArchiver(), new NoopDataSegmentAnnouncer(), null, null, null, null, NoopJoinableFactory.INSTANCE, null, new SegmentCacheManagerFactory(utils.getTestObjectMapper()), utils.getTestObjectMapper(), utils.getTestIndexIO(), null, null, null, utils.getTestIndexMergerV9(), null, node, null, null, new SingleFileTaskReportFileWriter(new File("fake")), null, AuthTestUtils.TEST_AUTHORIZER_MAPPER, new NoopChatHandlerProvider(), utils.getRowIngestionMetersFactory(), new TestAppenderatorsManager(), new NoopIndexingServiceClient(), null, null, null);
    runner = new SingleTaskBackgroundRunner(toolboxFactory, taskConfig, emitter, node, new ServerConfig());
}
Also used : ServiceEmitter(org.apache.druid.java.util.emitter.service.ServiceEmitter) NoopServiceEmitter(org.apache.druid.server.metrics.NoopServiceEmitter) NoopDataSegmentArchiver(org.apache.druid.segment.loading.NoopDataSegmentArchiver) SingleFileTaskReportFileWriter(org.apache.druid.indexing.common.SingleFileTaskReportFileWriter) NoopDataSegmentPusher(org.apache.druid.segment.loading.NoopDataSegmentPusher) NoopDataSegmentKiller(org.apache.druid.segment.loading.NoopDataSegmentKiller) NoopDataSegmentAnnouncer(org.apache.druid.server.coordination.NoopDataSegmentAnnouncer) NoopChatHandlerProvider(org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider) SegmentCacheManagerFactory(org.apache.druid.indexing.common.SegmentCacheManagerFactory) TaskActionClientFactory(org.apache.druid.indexing.common.actions.TaskActionClientFactory) NoopDataSegmentMover(org.apache.druid.segment.loading.NoopDataSegmentMover) TaskConfig(org.apache.druid.indexing.common.config.TaskConfig) NoopServiceEmitter(org.apache.druid.server.metrics.NoopServiceEmitter) TestUtils(org.apache.druid.indexing.common.TestUtils) AuthTestUtils(org.apache.druid.server.security.AuthTestUtils) ServerConfig(org.apache.druid.server.initialization.ServerConfig) NoopIndexingServiceClient(org.apache.druid.client.indexing.NoopIndexingServiceClient) TaskToolboxFactory(org.apache.druid.indexing.common.TaskToolboxFactory) DruidNode(org.apache.druid.server.DruidNode) File(java.io.File) TestAppenderatorsManager(org.apache.druid.indexing.common.task.TestAppenderatorsManager) Before(org.junit.Before)

Example 12 with NoopChatHandlerProvider

use of org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider in project druid by druid-io.

the class CompactionTaskTest method setupInjectablesInObjectMapper.

private static ObjectMapper setupInjectablesInObjectMapper(ObjectMapper objectMapper) {
    final GuiceAnnotationIntrospector guiceIntrospector = new GuiceAnnotationIntrospector();
    objectMapper.setAnnotationIntrospectors(new AnnotationIntrospectorPair(guiceIntrospector, objectMapper.getSerializationConfig().getAnnotationIntrospector()), new AnnotationIntrospectorPair(guiceIntrospector, objectMapper.getDeserializationConfig().getAnnotationIntrospector()));
    GuiceInjectableValues injectableValues = new GuiceInjectableValues(GuiceInjectors.makeStartupInjectorWithModules(ImmutableList.of(binder -> {
        binder.bind(AuthorizerMapper.class).toInstance(AuthTestUtils.TEST_AUTHORIZER_MAPPER);
        binder.bind(ChatHandlerProvider.class).toInstance(new NoopChatHandlerProvider());
        binder.bind(RowIngestionMetersFactory.class).toInstance(TEST_UTILS.getRowIngestionMetersFactory());
        binder.bind(CoordinatorClient.class).toInstance(COORDINATOR_CLIENT);
        binder.bind(SegmentCacheManagerFactory.class).toInstance(new SegmentCacheManagerFactory(objectMapper));
        binder.bind(AppenderatorsManager.class).toInstance(new TestAppenderatorsManager());
        binder.bind(IndexingServiceClient.class).toInstance(INDEXING_SERVICE_CLIENT);
    })));
    objectMapper.setInjectableValues(injectableValues);
    objectMapper.registerModule(new SimpleModule().registerSubtypes(new NamedType(NumberedShardSpec.class, "NumberedShardSpec")));
    objectMapper.registerModules(new IndexingServiceTuningConfigModule().getJacksonModules());
    return objectMapper;
}
Also used : AnnotationIntrospectorPair(com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair) NoopIndexingServiceClient(org.apache.druid.client.indexing.NoopIndexingServiceClient) IndexingServiceClient(org.apache.druid.client.indexing.IndexingServiceClient) NoopChatHandlerProvider(org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider) NamedType(com.fasterxml.jackson.databind.jsontype.NamedType) SegmentCacheManagerFactory(org.apache.druid.indexing.common.SegmentCacheManagerFactory) ChatHandlerProvider(org.apache.druid.segment.realtime.firehose.ChatHandlerProvider) NoopChatHandlerProvider(org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider) IndexingServiceTuningConfigModule(org.apache.druid.guice.IndexingServiceTuningConfigModule) AppenderatorsManager(org.apache.druid.segment.realtime.appenderator.AppenderatorsManager) AuthorizerMapper(org.apache.druid.server.security.AuthorizerMapper) CoordinatorClient(org.apache.druid.client.coordinator.CoordinatorClient) GuiceAnnotationIntrospector(org.apache.druid.guice.GuiceAnnotationIntrospector) GuiceInjectableValues(org.apache.druid.guice.GuiceInjectableValues) RowIngestionMetersFactory(org.apache.druid.segment.incremental.RowIngestionMetersFactory) SimpleModule(com.fasterxml.jackson.databind.module.SimpleModule)

Example 13 with NoopChatHandlerProvider

use of org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider in project druid by druid-io.

the class AbstractParallelIndexSupervisorTaskTest method prepareObjectMapper.

public void prepareObjectMapper(ObjectMapper objectMapper, IndexIO indexIO) {
    final TaskConfig taskConfig = new TaskConfig(null, null, null, null, null, false, null, null, null, false, false, TaskConfig.BATCH_PROCESSING_MODE_DEFAULT.name());
    objectMapper.setInjectableValues(new InjectableValues.Std().addValue(ExprMacroTable.class, LookupEnabledTestExprMacroTable.INSTANCE).addValue(IndexIO.class, indexIO).addValue(ObjectMapper.class, objectMapper).addValue(ChatHandlerProvider.class, new NoopChatHandlerProvider()).addValue(AuthConfig.class, new AuthConfig()).addValue(AuthorizerMapper.class, null).addValue(RowIngestionMetersFactory.class, new DropwizardRowIngestionMetersFactory()).addValue(DataSegment.PruneSpecsHolder.class, DataSegment.PruneSpecsHolder.DEFAULT).addValue(AuthorizerMapper.class, new AuthorizerMapper(ImmutableMap.of())).addValue(AppenderatorsManager.class, TestUtils.APPENDERATORS_MANAGER).addValue(LocalDataSegmentPuller.class, new LocalDataSegmentPuller()).addValue(CoordinatorClient.class, coordinatorClient).addValue(SegmentCacheManagerFactory.class, new SegmentCacheManagerFactory(objectMapper)).addValue(RetryPolicyFactory.class, new RetryPolicyFactory(new RetryPolicyConfig())).addValue(TaskConfig.class, taskConfig));
    objectMapper.registerSubtypes(new NamedType(ParallelIndexSupervisorTask.class, ParallelIndexSupervisorTask.TYPE), new NamedType(CompactionTask.CompactionTuningConfig.class, CompactionTask.CompactionTuningConfig.TYPE), new NamedType(SinglePhaseSubTask.class, SinglePhaseSubTask.TYPE), new NamedType(PartialHashSegmentGenerateTask.class, PartialHashSegmentGenerateTask.TYPE), new NamedType(PartialRangeSegmentGenerateTask.class, PartialRangeSegmentGenerateTask.TYPE), new NamedType(PartialGenericSegmentMergeTask.class, PartialGenericSegmentMergeTask.TYPE), new NamedType(PartialDimensionDistributionTask.class, PartialDimensionDistributionTask.TYPE), new NamedType(PartialDimensionCardinalityTask.class, PartialDimensionCardinalityTask.TYPE));
}
Also used : RetryPolicyConfig(org.apache.druid.indexing.common.RetryPolicyConfig) NoopChatHandlerProvider(org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider) NamedType(com.fasterxml.jackson.databind.jsontype.NamedType) SegmentCacheManagerFactory(org.apache.druid.indexing.common.SegmentCacheManagerFactory) TaskConfig(org.apache.druid.indexing.common.config.TaskConfig) AuthConfig(org.apache.druid.server.security.AuthConfig) DataSegment(org.apache.druid.timeline.DataSegment) RetryPolicyFactory(org.apache.druid.indexing.common.RetryPolicyFactory) LookupEnabledTestExprMacroTable(org.apache.druid.query.expression.LookupEnabledTestExprMacroTable) ExprMacroTable(org.apache.druid.math.expr.ExprMacroTable) DropwizardRowIngestionMetersFactory(org.apache.druid.indexing.common.stats.DropwizardRowIngestionMetersFactory) LocalDataSegmentPuller(org.apache.druid.segment.loading.LocalDataSegmentPuller) AuthorizerMapper(org.apache.druid.server.security.AuthorizerMapper) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) RowIngestionMetersFactory(org.apache.druid.segment.incremental.RowIngestionMetersFactory) DropwizardRowIngestionMetersFactory(org.apache.druid.indexing.common.stats.DropwizardRowIngestionMetersFactory)

Example 14 with NoopChatHandlerProvider

use of org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider in project druid by druid-io.

the class RealtimeIndexTaskTest method makeToolbox.

private TaskToolbox makeToolbox(final Task task, final TaskStorage taskStorage, final IndexerMetadataStorageCoordinator mdc, final File directory) {
    final TaskConfig taskConfig = new TaskConfig(directory.getPath(), null, null, 50000, null, true, null, null, null, false, false, TaskConfig.BATCH_PROCESSING_MODE_DEFAULT.name());
    final TaskLockbox taskLockbox = new TaskLockbox(taskStorage, mdc);
    try {
        taskStorage.insert(task, TaskStatus.running(task.getId()));
    } catch (EntryExistsException e) {
    // suppress
    }
    taskLockbox.syncFromStorage();
    final TaskActionToolbox taskActionToolbox = new TaskActionToolbox(taskLockbox, taskStorage, mdc, EMITTER, EasyMock.createMock(SupervisorManager.class));
    final TaskActionClientFactory taskActionClientFactory = new LocalTaskActionClientFactory(taskStorage, taskActionToolbox, new TaskAuditLogConfig(false));
    final QueryRunnerFactoryConglomerate conglomerate = new DefaultQueryRunnerFactoryConglomerate(ImmutableMap.of(TimeseriesQuery.class, new TimeseriesQueryRunnerFactory(new TimeseriesQueryQueryToolChest(), new TimeseriesQueryEngine(), new QueryWatcher() {

        @Override
        public void registerQueryFuture(Query query, ListenableFuture future) {
        // do nothing
        }
    })));
    handOffCallbacks = new ConcurrentHashMap<>();
    final SegmentHandoffNotifierFactory handoffNotifierFactory = new SegmentHandoffNotifierFactory() {

        @Override
        public SegmentHandoffNotifier createSegmentHandoffNotifier(String dataSource) {
            return new SegmentHandoffNotifier() {

                @Override
                public boolean registerSegmentHandoffCallback(SegmentDescriptor descriptor, Executor exec, Runnable handOffRunnable) {
                    handOffCallbacks.put(descriptor, new Pair<>(exec, handOffRunnable));
                    return true;
                }

                @Override
                public void start() {
                // Noop
                }

                @Override
                public void close() {
                // Noop
                }
            };
        }
    };
    final TestUtils testUtils = new TestUtils();
    final TaskToolboxFactory toolboxFactory = new TaskToolboxFactory(taskConfig, // taskExecutorNode
    null, taskActionClientFactory, EMITTER, new TestDataSegmentPusher(), new TestDataSegmentKiller(), // DataSegmentMover
    null, // DataSegmentArchiver
    null, new TestDataSegmentAnnouncer(), EasyMock.createNiceMock(DataSegmentServerAnnouncer.class), handoffNotifierFactory, () -> conglomerate, DirectQueryProcessingPool.INSTANCE, NoopJoinableFactory.INSTANCE, () -> EasyMock.createMock(MonitorScheduler.class), new SegmentCacheManagerFactory(testUtils.getTestObjectMapper()), testUtils.getTestObjectMapper(), testUtils.getTestIndexIO(), MapCache.create(1024), new CacheConfig(), new CachePopulatorStats(), testUtils.getTestIndexMergerV9(), EasyMock.createNiceMock(DruidNodeAnnouncer.class), EasyMock.createNiceMock(DruidNode.class), new LookupNodeService("tier"), new DataNodeService("tier", 1000, ServerType.INDEXER_EXECUTOR, 0), new NoopTestTaskReportFileWriter(), null, AuthTestUtils.TEST_AUTHORIZER_MAPPER, new NoopChatHandlerProvider(), testUtils.getRowIngestionMetersFactory(), new TestAppenderatorsManager(), new NoopIndexingServiceClient(), null, null, null);
    return toolboxFactory.build(task);
}
Also used : TimeseriesQuery(org.apache.druid.query.timeseries.TimeseriesQuery) Query(org.apache.druid.query.Query) QueryWatcher(org.apache.druid.query.QueryWatcher) TaskActionClientFactory(org.apache.druid.indexing.common.actions.TaskActionClientFactory) LocalTaskActionClientFactory(org.apache.druid.indexing.common.actions.LocalTaskActionClientFactory) TestDataSegmentAnnouncer(org.apache.druid.indexing.test.TestDataSegmentAnnouncer) TaskConfig(org.apache.druid.indexing.common.config.TaskConfig) DruidNodeAnnouncer(org.apache.druid.discovery.DruidNodeAnnouncer) TimeseriesQueryQueryToolChest(org.apache.druid.query.timeseries.TimeseriesQueryQueryToolChest) TaskAuditLogConfig(org.apache.druid.indexing.common.actions.TaskAuditLogConfig) AuthTestUtils(org.apache.druid.server.security.AuthTestUtils) TestUtils(org.apache.druid.indexing.common.TestUtils) QueryRunnerFactoryConglomerate(org.apache.druid.query.QueryRunnerFactoryConglomerate) DefaultQueryRunnerFactoryConglomerate(org.apache.druid.query.DefaultQueryRunnerFactoryConglomerate) TimeseriesQueryEngine(org.apache.druid.query.timeseries.TimeseriesQueryEngine) Executor(java.util.concurrent.Executor) NoopIndexingServiceClient(org.apache.druid.client.indexing.NoopIndexingServiceClient) TaskToolboxFactory(org.apache.druid.indexing.common.TaskToolboxFactory) SegmentDescriptor(org.apache.druid.query.SegmentDescriptor) CachePopulatorStats(org.apache.druid.client.cache.CachePopulatorStats) TaskActionToolbox(org.apache.druid.indexing.common.actions.TaskActionToolbox) LocalTaskActionClientFactory(org.apache.druid.indexing.common.actions.LocalTaskActionClientFactory) CacheConfig(org.apache.druid.client.cache.CacheConfig) TestDataSegmentPusher(org.apache.druid.indexing.test.TestDataSegmentPusher) TimeseriesQuery(org.apache.druid.query.timeseries.TimeseriesQuery) MonitorScheduler(org.apache.druid.java.util.metrics.MonitorScheduler) NoopChatHandlerProvider(org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider) SegmentHandoffNotifier(org.apache.druid.segment.handoff.SegmentHandoffNotifier) SegmentCacheManagerFactory(org.apache.druid.indexing.common.SegmentCacheManagerFactory) DefaultQueryRunnerFactoryConglomerate(org.apache.druid.query.DefaultQueryRunnerFactoryConglomerate) EntryExistsException(org.apache.druid.metadata.EntryExistsException) LookupNodeService(org.apache.druid.discovery.LookupNodeService) TestDataSegmentKiller(org.apache.druid.indexing.test.TestDataSegmentKiller) DataSegmentServerAnnouncer(org.apache.druid.server.coordination.DataSegmentServerAnnouncer) SegmentHandoffNotifierFactory(org.apache.druid.segment.handoff.SegmentHandoffNotifierFactory) SupervisorManager(org.apache.druid.indexing.overlord.supervisor.SupervisorManager) TimeseriesQueryRunnerFactory(org.apache.druid.query.timeseries.TimeseriesQueryRunnerFactory) TaskLockbox(org.apache.druid.indexing.overlord.TaskLockbox) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) DruidNode(org.apache.druid.server.DruidNode) DataNodeService(org.apache.druid.discovery.DataNodeService)

Example 15 with NoopChatHandlerProvider

use of org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider in project druid by druid-io.

the class ClientCompactionTaskQuerySerdeTest method setupInjectablesInObjectMapper.

private static ObjectMapper setupInjectablesInObjectMapper(ObjectMapper objectMapper) {
    final GuiceAnnotationIntrospector guiceIntrospector = new GuiceAnnotationIntrospector();
    objectMapper.setAnnotationIntrospectors(new AnnotationIntrospectorPair(guiceIntrospector, objectMapper.getSerializationConfig().getAnnotationIntrospector()), new AnnotationIntrospectorPair(guiceIntrospector, objectMapper.getDeserializationConfig().getAnnotationIntrospector()));
    GuiceInjectableValues injectableValues = new GuiceInjectableValues(GuiceInjectors.makeStartupInjectorWithModules(ImmutableList.of(binder -> {
        binder.bind(AuthorizerMapper.class).toInstance(AuthTestUtils.TEST_AUTHORIZER_MAPPER);
        binder.bind(ChatHandlerProvider.class).toInstance(new NoopChatHandlerProvider());
        binder.bind(RowIngestionMetersFactory.class).toInstance(ROW_INGESTION_METERS_FACTORY);
        binder.bind(CoordinatorClient.class).toInstance(COORDINATOR_CLIENT);
        binder.bind(SegmentCacheManagerFactory.class).toInstance(new SegmentCacheManagerFactory(objectMapper));
        binder.bind(AppenderatorsManager.class).toInstance(APPENDERATORS_MANAGER);
        binder.bind(IndexingServiceClient.class).toInstance(new NoopIndexingServiceClient());
    })));
    objectMapper.setInjectableValues(injectableValues);
    objectMapper.registerSubtypes(new NamedType(ParallelIndexTuningConfig.class, "index_parallel"));
    return objectMapper;
}
Also used : AnnotationIntrospectorPair(com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair) IndexingServiceClient(org.apache.druid.client.indexing.IndexingServiceClient) NoopIndexingServiceClient(org.apache.druid.client.indexing.NoopIndexingServiceClient) NoopChatHandlerProvider(org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider) NamedType(com.fasterxml.jackson.databind.jsontype.NamedType) SegmentCacheManagerFactory(org.apache.druid.indexing.common.SegmentCacheManagerFactory) ChatHandlerProvider(org.apache.druid.segment.realtime.firehose.ChatHandlerProvider) NoopChatHandlerProvider(org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider) NoopIndexingServiceClient(org.apache.druid.client.indexing.NoopIndexingServiceClient) AppenderatorsManager(org.apache.druid.segment.realtime.appenderator.AppenderatorsManager) AuthorizerMapper(org.apache.druid.server.security.AuthorizerMapper) CoordinatorClient(org.apache.druid.client.coordinator.CoordinatorClient) ParallelIndexTuningConfig(org.apache.druid.indexing.common.task.batch.parallel.ParallelIndexTuningConfig) GuiceAnnotationIntrospector(org.apache.druid.guice.GuiceAnnotationIntrospector) GuiceInjectableValues(org.apache.druid.guice.GuiceInjectableValues) RowIngestionMetersFactory(org.apache.druid.segment.incremental.RowIngestionMetersFactory)

Aggregations

NoopChatHandlerProvider (org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider)17 SegmentCacheManagerFactory (org.apache.druid.indexing.common.SegmentCacheManagerFactory)11 NoopIndexingServiceClient (org.apache.druid.client.indexing.NoopIndexingServiceClient)10 TaskConfig (org.apache.druid.indexing.common.config.TaskConfig)9 TaskToolboxFactory (org.apache.druid.indexing.common.TaskToolboxFactory)8 TaskActionClientFactory (org.apache.druid.indexing.common.actions.TaskActionClientFactory)7 Test (org.junit.Test)7 DimensionsSpec (org.apache.druid.data.input.impl.DimensionsSpec)6 StringDimensionSchema (org.apache.druid.data.input.impl.StringDimensionSchema)6 CountAggregatorFactory (org.apache.druid.query.aggregation.CountAggregatorFactory)6 SegmentHandoffNotifierFactory (org.apache.druid.segment.handoff.SegmentHandoffNotifierFactory)6 DruidNode (org.apache.druid.server.DruidNode)6 AuthorizerMapper (org.apache.druid.server.security.AuthorizerMapper)6 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 NamedType (com.fasterxml.jackson.databind.jsontype.NamedType)5 File (java.io.File)5 CachePopulatorStats (org.apache.druid.client.cache.CachePopulatorStats)5 DataNodeService (org.apache.druid.discovery.DataNodeService)5 DruidNodeAnnouncer (org.apache.druid.discovery.DruidNodeAnnouncer)5 LookupNodeService (org.apache.druid.discovery.LookupNodeService)5