Search in sources :

Example 1 with IndexingServiceTuningConfigModule

use of org.apache.druid.guice.IndexingServiceTuningConfigModule 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)

Aggregations

AnnotationIntrospectorPair (com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair)1 NamedType (com.fasterxml.jackson.databind.jsontype.NamedType)1 SimpleModule (com.fasterxml.jackson.databind.module.SimpleModule)1 CoordinatorClient (org.apache.druid.client.coordinator.CoordinatorClient)1 IndexingServiceClient (org.apache.druid.client.indexing.IndexingServiceClient)1 NoopIndexingServiceClient (org.apache.druid.client.indexing.NoopIndexingServiceClient)1 GuiceAnnotationIntrospector (org.apache.druid.guice.GuiceAnnotationIntrospector)1 GuiceInjectableValues (org.apache.druid.guice.GuiceInjectableValues)1 IndexingServiceTuningConfigModule (org.apache.druid.guice.IndexingServiceTuningConfigModule)1 SegmentCacheManagerFactory (org.apache.druid.indexing.common.SegmentCacheManagerFactory)1 RowIngestionMetersFactory (org.apache.druid.segment.incremental.RowIngestionMetersFactory)1 AppenderatorsManager (org.apache.druid.segment.realtime.appenderator.AppenderatorsManager)1 ChatHandlerProvider (org.apache.druid.segment.realtime.firehose.ChatHandlerProvider)1 NoopChatHandlerProvider (org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider)1 AuthorizerMapper (org.apache.druid.server.security.AuthorizerMapper)1