Search in sources :

Example 1 with DropwizardRowIngestionMetersFactory

use of org.apache.druid.indexing.common.stats.DropwizardRowIngestionMetersFactory in project druid by druid-io.

the class KinesisIndexTaskSerdeTest method createObjectMapper.

private static ObjectMapper createObjectMapper() {
    DruidModule module = new KinesisIndexingServiceModule();
    Injector injector = Initialization.makeInjectorWithModules(GuiceInjectors.makeStartupInjector(), Arrays.asList(module, (Module) binder -> {
        binder.bindConstant().annotatedWith(Names.named("serviceName")).to("test");
        binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8000);
        binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(9000);
        binder.bind(ChatHandlerProvider.class).toInstance(new NoopChatHandlerProvider());
        binder.bind(RowIngestionMetersFactory.class).toInstance(new DropwizardRowIngestionMetersFactory());
        binder.bind(AppenderatorsManager.class).toInstance(new TestAppenderatorsManager());
    }));
    ObjectMapper objectMapper = injector.getInstance(ObjectMapper.class);
    module.getJacksonModules().forEach(objectMapper::registerModule);
    return objectMapper;
}
Also used : Injector(com.google.inject.Injector) NoopChatHandlerProvider(org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider) TestAppenderatorsManager(org.apache.druid.indexing.common.task.TestAppenderatorsManager) AppenderatorsManager(org.apache.druid.segment.realtime.appenderator.AppenderatorsManager) DruidModule(org.apache.druid.initialization.DruidModule) Module(com.google.inject.Module) DruidModule(org.apache.druid.initialization.DruidModule) ChatHandlerProvider(org.apache.druid.segment.realtime.firehose.ChatHandlerProvider) NoopChatHandlerProvider(org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider) DropwizardRowIngestionMetersFactory(org.apache.druid.indexing.common.stats.DropwizardRowIngestionMetersFactory) RowIngestionMetersFactory(org.apache.druid.segment.incremental.RowIngestionMetersFactory) TestAppenderatorsManager(org.apache.druid.indexing.common.task.TestAppenderatorsManager) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) DropwizardRowIngestionMetersFactory(org.apache.druid.indexing.common.stats.DropwizardRowIngestionMetersFactory)

Example 2 with DropwizardRowIngestionMetersFactory

use of org.apache.druid.indexing.common.stats.DropwizardRowIngestionMetersFactory 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)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 DropwizardRowIngestionMetersFactory (org.apache.druid.indexing.common.stats.DropwizardRowIngestionMetersFactory)2 RowIngestionMetersFactory (org.apache.druid.segment.incremental.RowIngestionMetersFactory)2 NoopChatHandlerProvider (org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider)2 NamedType (com.fasterxml.jackson.databind.jsontype.NamedType)1 Injector (com.google.inject.Injector)1 Module (com.google.inject.Module)1 RetryPolicyConfig (org.apache.druid.indexing.common.RetryPolicyConfig)1 RetryPolicyFactory (org.apache.druid.indexing.common.RetryPolicyFactory)1 SegmentCacheManagerFactory (org.apache.druid.indexing.common.SegmentCacheManagerFactory)1 TaskConfig (org.apache.druid.indexing.common.config.TaskConfig)1 TestAppenderatorsManager (org.apache.druid.indexing.common.task.TestAppenderatorsManager)1 DruidModule (org.apache.druid.initialization.DruidModule)1 ExprMacroTable (org.apache.druid.math.expr.ExprMacroTable)1 LookupEnabledTestExprMacroTable (org.apache.druid.query.expression.LookupEnabledTestExprMacroTable)1 LocalDataSegmentPuller (org.apache.druid.segment.loading.LocalDataSegmentPuller)1 AppenderatorsManager (org.apache.druid.segment.realtime.appenderator.AppenderatorsManager)1 ChatHandlerProvider (org.apache.druid.segment.realtime.firehose.ChatHandlerProvider)1 AuthConfig (org.apache.druid.server.security.AuthConfig)1 AuthorizerMapper (org.apache.druid.server.security.AuthorizerMapper)1